芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/DataTables/ConsentDataTable.php
eloquent($query) ->addIndexColumn() ->addColumn('check', function ($row) { return '
'; }) ->addColumn('action', function ($row) { $action = '
' . __('app.edit') . '
'; $action .= '
' . __('app.delete') . '
'; return $action; }) ->editColumn( 'created_at', function ($row) { return Carbon::parse($row->created_at)->translatedFormat($this->company->date_format); } ) ->rawColumns(['status', 'action', 'check']); } /** * @param PurposeConsent $model * @return \Illuminate\Database\Query\Builder */ public function query(PurposeConsent $model) { return $model->select('id', 'name', 'description', 'created_at'); } /** * Optional method if you want to use html builder. * * @return \Yajra\DataTables\Html\Builder */ public function html() { $dataTable = $this->setBuilder('consent-table') ->parameters([ 'initComplete' => 'function () { window.LaravelDataTables["consent-table"].buttons().container() .appendTo("#table-actions") }', 'fnDrawCallback' => 'function( oSettings ) { }', ]); if (canDataTableExport()) { $dataTable->buttons(Button::make(['extend' => 'excel', 'text' => '
' . trans('app.exportExcel')])); } return $dataTable; } /** * Get columns. * * @return array */ protected function getColumns() { return [ 'check' => [ 'title' => '
', 'exportable' => false, 'orderable' => false, 'searchable' => false ], __('app.id') => ['data' => 'id', 'name' => 'id', 'visible' => false, 'exportable' => false, 'title' => __('app.id')], '#' => ['data' => 'DT_RowIndex', 'orderable' => false, 'searchable' => false, 'visible' => false, 'title' => '#'], __('app.name') => ['data' => 'name', 'name' => 'name', 'title' => __('app.name')], __('app.description') => ['data' => 'description', 'name' => 'description', 'title' => __('app.description')], __('app.createdOn') => ['data' => 'created_at', 'name' => 'created_at', 'title' => __('app.createdOn')], Column::computed('action', __('app.action')) ->exportable(false) ->printable(false) ->orderable(false) ->searchable(false) ->width(210) ->addClass('text-right') ]; } }