Skip to main content
Advanced Search 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. Advanced Search is disabled by default. To enable, add advancedSearchEnabled() to your panel provider:
Note: Tables that use Filament’s ->searchUsing() callback keep Filament’s search, as Advanced Tables cannot know how your callback should be changed.
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. 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)
Selected options appear as badges in the search input:
  • 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
An information icon displays a search reference with all available keyboard shortcuts and syntax options. The clear button (X icon) removes all search groups and resets the search.

Keyboard navigation

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: For example, typing =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. If the shortcuts get in the way of your users’ searches, you can disable them.

”Does not” constraints

A “does not” constraint always returns the exact opposite of its positive constraint. This means that:
  • A record with an empty value is included, since an empty value does not contain the search term.
  • For a relationship column, a record is included when none of its related records match, including when it has no related records at all.
  • “Does not contain” with several words returns the records that are missing at least one of the words. Wrap the words in quotes to exclude an exact phrase instead.

Words and phrases

“Contains” and “Does not contain” split the search term into words, just like Filament’s search. Each word must match for a record to be included, so searching for John Doe only matches records that contain both “John” and “Doe”. If your table uses splitSearchTerms(false) the search term is kept as a single phrase. 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. “Equals”, “Starts with”, “Ends with”, and their opposites always treat the search term as a single phrase, so “Starts with: city of” matches “City of Gold”.

Date and number columns

“Equals” and “Does not equal” compare date and number columns by their value instead of as text:
  • A date such as 2025-01-15 matches the whole day, so it also finds records that were stored with a time. Dates can be typed as 2025-01-15, 2025/01/15, 2025.01.15, or in the format set with your table’s defaultDateDisplayFormat() and defaultDateTimeDisplayFormat() methods. Month and day names are read in the locale of your application. Adding a time, like 2025-01-15 10:30:00, matches that second.
  • A number such as 5 matches 5, 5.0, and 5.00.
  • A search term that is not a date or a number is never compared to a date or number column.
Note: Dates are compared as they are stored in the database. If you display dates in a different timezone, use a date filter instead.

Custom search queries

Columns that use a custom search query, like ->searchable(query: ...), are searched as “contains” regardless of the selected constraint, as Advanced Tables cannot know how your query should be changed. The “does not” constraints exclude the records that your query matches. To support every constraint, accept the $constraint parameter in your query. It is always the positive constraint, since Advanced Tables takes care of the “does not” constraints for you:
Note: Do not add a type to $constraint and give it a default value of null. Filament also runs your query when Advanced Search is not used, such as for individual column searches, where $constraint is not available.
The same applies to columns translated with a translatable content driver and to closures passed to your table’s ->searchable([...]) method. Since those closures do not have a name, they are only searched when the user is searching all columns.

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:
When enabled, the dropdown displays two column sections:
  • Columns — Table columns that are visible and globally searchable
  • Database — Extra searchable columns from related models (configured via $table->getExtraSearchableColumns())
Selected columns appear as blue badges in the search input. Each search group can target different columns. When no columns are selected, all searchable columns are searched.

Grouping

Grouping allows users to build complex multi-group search queries with AND/OR logic. To enable:
When enabled, the dropdown includes a Boolean section with AND and OR operators. Selecting an operator creates a new search group. The first group has no operator; subsequent groups are prefixed with an AND or OR badge. Users can click an operator badge to toggle between AND and OR.

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 same WHERE clause, while groups connected by OR create separate WHERE clauses joined with orWhere(). For example:
Translates to:

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.
When Advanced Search is enabled it replaces Filament’s search, but everything that sets Filament’s search keeps working and is treated as a “contains” search across all columns:
  • Links to a List page with a ?search= query string.
  • The searchTable() testing helper.
  • User Views that were saved before Advanced Search was enabled.
Note: The search is moved from Filament’s $tableSearch property to the $advancedSearch property, so a test that asserts tableSearch after calling searchTable() should assert advancedSearch instead.

Keeping the search in the URL

Advanced Search is kept in the URL on List pages and Manage Related Records pages. Relation managers and table widgets can share a page, so their search is not kept in the URL. You may change this by overriding the shouldBindAdvancedSearchToUrl() method on your Livewire component:

Widgets

If your widgets read the page’s table using Filament’s ExposesTableToWidgets and InteractsWithPageTable traits, use Advanced Tables’ Archilex\AdvancedTables\Widgets\Concerns\ExposesTableToWidgets and Archilex\AdvancedTables\Widgets\Concerns\InteractsWithPageTable traits instead so the search is applied to your widgets as well.

Using with Preset Views

You can apply default search settings to your Preset Views using the defaultSearch() method. Each search group is an array with columns, constraint, value, and operator keys:
You may create multi-group searches with AND/OR operators:
The defaultSearch() method accepts the following parameter:
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:

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 the AdvancedTablesPlugin object inside your PanelProvider. Advanced Search is disabled by default and must be enabled in your panel provider. If you have enabled it globally but want to disable it for a specific table, you may override the advancedSearchIsEnabled() method on your List page:

Disabling the search shortcuts

The syntax shortcuts can get in the way when your users search for values that start with one of the shortcuts, like $500 or -250. You may disable them using advancedSearchConstraintSyntaxEnabled(). Users can still select a constraint from the dropdown:

Limiting the number of words

Each word in a “contains” search is searched for in every searchable column. You may limit the number of words that are searched using advancedSearchMaxWords(). Any additional words are ignored:
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 using advancedSearchTriggerAction(), 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 the advanced_search section in the advanced-tables.php language file.