comments
This commit is contained in:
35
app/Datatables/Admin/Core/CommentsDataTable.php
Normal file
35
app/Datatables/Admin/Core/CommentsDataTable.php
Normal 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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user