eloquent($query) ->addColumn('action', function ($data) { return view('people::customers.partials.actions', compact('data')); }); } public function query(Customer $model) { return $model->newQuery(); } public function html() { return $this->builder() ->setTableId('customers-table') ->columns($this->getColumns()) ->minifiedAjax() ->dom("<'row'<'col-md-3'l><'col-md-5 mb-2'B><'col-md-4'f>> . 'tr' . <'row'<'col-md-5'i><'col-md-7 mt-2'p>>") ->orderBy(4) ->buttons( Button::make('excel') ->text(' Excel'), Button::make('print') ->text(' Print'), Button::make('reset') ->text(' Reset'), Button::make('reload') ->text(' Reload') ); } protected function getColumns() { return [ Column::make('customer_name') ->className('text-center align-middle'), Column::make('customer_email') ->className('text-center align-middle'), Column::make('customer_phone') ->className('text-center align-middle'), Column::computed('action') ->exportable(false) ->printable(false) ->className('text-center align-middle'), Column::make('created_at') ->visible(false) ]; } protected function filename(): string { return 'Customers_' . date('YmdHis'); } }