searchable() ->sortable(), new Column('Department Name', 'subDepartment.department.name') ->searchable() ->sortable(), new Column('SubDepartment Name', 'subDepartment.name') ->searchable() ->exportable() ->sortable(), ); $this->tableSettings = new GenericTableSettings(new Product(), $columns); } public function onExport(\Mmt\GenericTable\Support\ExportEventArgs $args): \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\BinaryFileResponse { $args->query->take(5); return $args->export(); } }