Pagination
Disabling pagination
By default, tables will be paginated. To disable this, you should use the$table->paginated(false) method:
Customizing the pagination options
You may customize the options for the paginated records per page select by passing them to thepaginated() method:
Customizing the default pagination page option
To customize the default number of records shown use thedefaultPaginationPageOption() method:
Preventing query string conflicts with the pagination page
By default, Livewire stores the pagination state in apage parameter of the URL query string. If you have multiple tables on the same page, this will mean that the pagination state of one table may be overwritten by the state of another table.
To fix this, you may define a $table->queryStringIdentifier(), to return a unique query string identifier for that table:
Displaying links to the first and the last pagination page
To add “extreme” links to the first and the last page using theextremePaginationLinks() method:
Using simple pagination
You may use simple pagination by overridingpaginateTableQuery() method.
First, locate your Livewire component. If you’re using a resource from the Panel Builder and you want to add simple pagination to the List page, you’ll want to open the Pages/List.php file in the resource, not the resource class itself.
Using cursor pagination
You may use cursor pagination by overridingpaginateTableQuery() method.
First, locate your Livewire component. If you’re using a resource from the Panel Builder and you want to add simple pagination to the List page, you’ll want to open the Pages/List.php file in the resource, not the resource class itself.
Record URLs (clickable rows)
You may allow table rows to be completely clickable by using the$table->recordUrl() method:
posts.edit route.
You may also open the URL in a new tab:
Reordering records
To allow the user to reorder records using drag and drop in your table, you can use the$table->reorderable() method:
sort attribute to the $fillable array there.
When making the table reorderable, a new button will be available on the table to toggle reordering.
The reorderable() method accepts the name of a column to store the record order in. If you use something like spatie/eloquent-sortable with an order column such as order_column, you may use this instead:
reorderable() method also accepts a boolean condition as its second parameter, allowing you to conditionally enable reordering:
Enabling pagination while reordering
Pagination will be disabled in reorder mode to allow you to move records between pages. It is generally bad UX to re-enable pagination while reordering, but if you are sure then you can use$table->paginatedWhileReordering():
Customizing the reordering trigger action
To customize the reordering trigger button, you may use thereorderRecordsTriggerAction() method, passing a closure that returns an action. All methods that are available to customize action trigger buttons can be used:
Customizing the table header
You can add a heading to a table using the$table->heading() method:
$table->description() method:
$table->header() method to customize the entire header:
Polling table content
You may poll table content so that it refreshes at a set interval, using the$table->poll() method:
Deferring loading
Tables with lots of data might take a while to load, in which case you can load the table data asynchronously using thedeferLoading() method:
Searching records with Laravel Scout
While Filament doesn’t provide a direct integration with Laravel Scout, you may override methods to integrate it. Use awhereIn() clause to filter the query for Scout results:
whereIn() method to retrieve results internally, so there is no performance penalty for using it.
The applyColumnSearchesToTableQuery() method ensures that searching individual columns will still work. You can replace that method with your own implementation if you want to use Scout for those search inputs as well.
For the global search input to show, at least one column in the table needs to be searchable(). Alternatively, if you are using Scout to control which columns are searchable already, you can simply pass searchable() to the entire table instead:
Query string
Livewire ships with a feature to store data in the URL’s query string, to access across requests. With Filament, this allows you to store your table’s filters, sort, search and pagination state in the URL. To store the filters, sorting, and search state of your table in the query string:Styling table rows
Striped table rows
To enable striped table rows, you can use thestriped() method:
Custom row classes
You may want to conditionally style rows based on the record data. This can be achieved by specifying a string or array of CSS classes to be applied to the row using the$table->recordClasses() method:
content configuration in tailwind.config.js to also scan for classes inside your directory: './app/Filament/**/*.php'
Resetting the table
If you make changes to the table definition during a Livewire request, for example, when consuming a public property in thetable() method, you may need to reset the table to ensure that the changes are applied. To do this, you can call the resetTable() method on the Livewire component:
Global settings
To customize the default configuration that is used for all tables, you can call the staticconfigureUsing() method from the boot() method of a service provider. The function will be run for each table that gets created: