This commit is contained in:
Ludovic CANDELLIER
2021-08-21 19:48:21 +02:00
parent 9a0601d473
commit 81fbec892c
24 changed files with 423 additions and 65 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Datatables\Admin\Core;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Admin\Core\Comment;
use App\Repositories\Core\Comments;
class CommentsDataTable extends DataTable
{
public $model_name = 'comments';
public function __construct()
{
$this->url = route('Admin.Core.Comments.index');
}
public function query(Comment $model)
{
$model = $model::with(['user'])->select('*');
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('updated_at')->title(__('date'))->width('80')->class('text-center')->searchable(false),
Column::make('user.name')->title(__('name'))->searchable(false),
Column::make('comment')->title(__('comments'))->searchable(false),
self::makeColumnButtons(),
];
}
}