Filters

Select

SelectFilter narrows rows to one or many values, from a list or a relationship.

use Xelqun\Tables\Filters\SelectFilter;

SelectFilter::make('status')->options(['draft' => 'Draft', 'active' => 'Active']);

attribute() sets the column, which defaults to the filter's name. multiple() lets people pick several.

SelectFilter::make('state')->attribute('status')->multiple()->options($statuses);

Relationships

SelectFilter::make('category')->relationship('category', 'name');

It keeps rows that have the chosen record.

A relationship filter sends every related record. For a long list, use a custom filter with an async Select.