Advanced Search replaces Filament’s default table search with a powerful query builder. Your users can search using eight different constraints like “equals”, “starts with”, “ends with”, and more. They can select which columns to search, build multi-group queries with AND/OR logic, and use keyboard syntax shortcuts to quickly change the search behavior directly from the search input. Selected options appear as interactive badges in the search field for easy management. Advanced Search is fully integrated with Preset Views, User Views, and Quick Filters.
Enabling Advanced Search
Advanced Search is disabled by default. To enable, addadvancedSearchEnabled() to your panel provider:
Note: Advanced Search is automatically disabled on tables that use Filament’s ->searchUsing() callback.
After enabling, be sure to run npm run build and php artisan filament:upgrade.
Advanced Search options can also be configured in the advanced_search section of config/advanced-tables.php.
Using Advanced Search
Once enabled, the search field includes an interactive dropdown for building search queries. Clicking the search input or pressing the down arrow key opens the dropdown, which is organized into the following sections:- Constraints — Select a search constraint (e.g., Contains, Equals, Starts with)
- Columns — Select which columns to search (when column selection is enabled)
- Database — Select extra searchable columns from related models (when column selection is enabled)
- Boolean — Add AND/OR operators to create search groups (when grouping is enabled)
- Constraint badges (gray) — Show the active search constraint
- Column badges (blue) — Show which columns are being searched
- Operator badges (yellow) — Show the AND/OR operator connecting search groups
Keyboard navigation
| Key | Action |
|---|---|
↓ | Open dropdown |
↑ ↓ | Navigate dropdown items |
↵ | Select highlighted item or submit search |
⌫ | Remove last badge from active group |
Search Constraints
Advanced Search includes eight search constraints. Users can select a constraint from the dropdown or type a syntax prefix directly in the search input:| Constraint | Syntax | Description | SQL Operator |
|---|---|---|---|
| Contains | (none) | Matches records containing the search term anywhere | LIKE %value% |
| Does not contain | - | Excludes records containing the search term | NOT LIKE %value% |
| Equals | = | Matches records where the value is exactly the search term | = value |
| Does not equal | -= | Excludes records where the value is exactly the search term | != value |
| Starts with | ^ | Matches records starting with the search term | LIKE value% |
| Does not start with | -^ | Excludes records starting with the search term | NOT LIKE value% |
| Ends with | $ | Matches records ending with the search term | LIKE %value |
| Does not end with | -$ | Excludes records ending with the search term | NOT LIKE %value |
=order will search for records that exactly equal “order”, while typing -^test will exclude records that start with “test”.
Tip: The search reference (info icon) in the dropdown displays all available syntax shortcuts for quick reference.
Word Splitting
By default, multi-word search terms are automatically split into individual words. Each word must match for a record to be included in the results. For example, searching forJohn Doe with the Contains constraint will only match records that contain both “John” and “Doe”. This applies to all constraints except Equals and Does not equal.
The Equals and Does not equal constraints do not split words — the entire search term is treated as a single value for exact comparison.
To search for an exact multi-word phrase without splitting, wrap the search term in quotes. For example, "John Doe" will match the exact phrase “John Doe” rather than matching “John” and “Doe” separately.
Column Selection
By default, Advanced Search searches all globally searchable columns. You can enable column selection to let users choose which specific columns to search:- Columns — Table columns that are visible and globally searchable
- Database — Extra searchable columns from related models (configured via
$table->getExtraSearchableColumns())
Grouping
Grouping allows users to build complex multi-group search queries with AND/OR logic. To enable:How groups combine
Groups connected by AND narrow results — all conditions must match. Groups connected by OR broaden results — any condition can match. Under the hood, groups connected by AND stay in the sameWHERE clause, while groups connected by OR create separate WHERE clauses joined with orWhere(). For example:
Maximum groups
You can limit the maximum number of search groups (default is 5):Boolean Syntax
In addition to using the dropdown, users can type& for AND or | for OR directly in the search input to create new groups. This feature is disabled by default:
Note: Boolean syntax is disabled by default because&and|symbols may appear in legitimate search terms. Only enable this after educating your users about the syntax. If a user needs to search for a term containing&or|, they can wrap the search term in quotes to prevent it from being interpreted as a boolean operator. Advanced Search is smart enough to not interpret these symbols as operators while the user is actively typing — they are only parsed when the search is submitted.
Using with Preset Views
You can apply default search settings to your Preset Views using thedefaultSearch() method. Each search group is an array with columns, constraint, value, and operator keys:
defaultSearch() method accepts the following parameter:
| Parameter | Type | Description |
|---|---|---|
$search | string | array | Closure | A string for a simple search term, or an array of search group arrays for full control |
Tip: You can also pass a simple string like ->defaultSearch('pending') which will be used as a search term with the “contains” constraint. See Applying a default search in the Preset Views documentation for more on the string format.
Each search group array has the following keys:
| Key | Type | Description |
|---|---|---|
columns | string[] | Column names to search. Empty array searches all columns. |
constraint | string | The search constraint (e.g., 'contains', 'equals', 'starts_with') |
value | string | The search term |
operator | string | null | 'and', 'or', or null for the first group |
Using with User Views
Advanced Search settings are automatically saved and restored with User Views. When a user saves a User View, all search groups including their constraints, selected columns, values, and operators are included. When the User View is loaded, all search settings are restored.Advanced Search Configurations
Advanced Tables offers multiple ways to customize Advanced Search. Unless specified otherwise, these options can be configured directly on theAdvancedTablesPlugin object inside your PanelProvider.
Dropdown column order
By default, constraints are shown first in the dropdown. To show columns first instead:Opening dropdown on focus
By default, the dropdown opens when the user presses the down arrow key. To open the dropdown automatically when the search input receives focus:Keybindings
You can configure keyboard shortcuts to focus the search input:Customizing the trigger action
You can customize the Advanced Search trigger button usingadvancedSearchTriggerAction(), following the same pattern as Filament’s trigger action customization:
Customizing labels
You may customize Advanced Search labels in the language file. Publish the language files and update theadvanced_search section in the advanced-tables.php language file.