Вот мой код:
Код: Выделить всё
public function dataTable($query)
{
$datatables = datatables()->eloquent($query);
return $datatables;
}
public function query()
{
$report= AdminReport::select();
return $this->applyScopes($report);
}
public function html()
{
return $this->builder()
->setTableId('admin-reports-table')
->columns($this->getColumns())
->minifiedAjax()
->dom('Bflrtip')
->orderBy(0);
}
protected function getColumns()
{
return [
'id' => ['title' => 'ID #'],
'player_name' => ['title' => 'Player Name'],
'balance' => ['title' => 'Current Balance'],
];
}
Код: Выделить всё
Query
{{$dataTable->table(['class'=>'table table-bordered table-hover'])}}
@push('scripts')
{{$dataTable->scripts()}}
@endpush
Заранее спасибо, ребята.>
Подробнее здесь: https://stackoverflow.com/questions/604 ... es-service
Мобильная версия