Files
opensem/app/Datatables/Admin/Core/CommentsDataTable.php
Ludovic CANDELLIER 9ca510086b comments
2021-08-21 19:48:21 +02:00

36 lines
923 B
PHP

<?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(),
];
}
}