How to add a required filter before listing items
I have a page where I need to display a list of items based on a previous required select filter. IE:
Having a list of books, I need to select a book category before displaying the books list in order to show only the selected category books.
Is this possible. I'm adding the filter to the table but the query is not filtering the default selection and this also gives error when I remove the filter indicator on the table.
1 Reply
Try using a Filter with a custom form and then using dependent selects.
https://filamentphp.com/docs/2.x/tables/filters#custom-filter-forms
https://filamentphp.com/docs/2.x/forms/advanced#dependant-fields--components
Alternatively, since filters are always reactive you might be able to update a second filter by getting the results of the first filter from the filament’s
$livewire->tableFilters
array.Filament
Filters - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.