Closed jamesdordoy closed 2 years ago
Hey @pascalbaljet,
Just a suggestion for anyone looking to clean up a simple datatable:
$languages = QueryBuilder::for(Language::class) ->defaultSort('id') ->allowedSorts($this->datatableColumns) ->paginate() ->withQueryString(); $callback = fn (InertiaTable $table) => $table->addSearchRows($this->datatableSearchRows) ->addColumns($this->datatableColumns); return Inertia::render( 'Languages/Index', [ 'languages' => $languages, ] )->table($callback);
Hey @pascalbaljet,
Just a suggestion for anyone looking to clean up a simple datatable: