Introduction
Filters allow users to scope table data and find specific information. They’re defined in the$table->filters() method and provide various ways to constrain your query.
Available filter types
Basic Filter
Simple checkbox or toggle filter
Select Filter
Dropdown with predefined options
Ternary Filter
Three-state filter (true/false/blank)
Query Builder
Advanced filter combinations
Basic filter
The default filter renders as a checkbox. When checked, thequery() callback is applied:
Using a toggle instead
Replace the checkbox with a toggle button:Applying by default
Enable a filter by default:Select filter
Provide a dropdown of predefined options:Custom attribute
By default, the filter uses its name as the column. Override withattribute():
Multi-select filters
Allow selecting multiple options:Relationship filters
Automatically populate options from a relationship:Searchable relationship filters
Including empty relationships
Add a “None” option for records without a relationship:Applying select filters by default
Native select vs. custom select
Use a native HTML select for better mobile experience:Ternary filter
Provide three states: true, false, and blank (no filter):Simplified boolean ternary
For simple boolean columns:Filtering soft-deleted records
Use the built-inTrashedFilter:
Query Builder filter
Allow users to create complex filter combinations:Available constraints
TextConstraint- Text fields with operators like contains, starts with, equalsBooleanConstraint- True/false valuesDateConstraint- Date comparisonsNumberConstraint- Numeric comparisonsSelectConstraint- Predefined optionsRelationshipConstraint- Related records
Custom filters
Build custom filters using any form field:Indicators for custom filters
Show active filter indicators:Filter layout
By default, filters appear in a dropdown. Change the layout:FiltersLayout::Dropdown(default)FiltersLayout::AboveContentFiltersLayout::AboveContentCollapsibleFiltersLayout::BelowContent