Skip to main content
Advanced Search Advanced Search replaces Filament table’s search field with powerful search constraints and column selection. In addition to the default “contains” search, your users can now search using eight different constraints like “starts with”, “matches”, “ends with”, and more. Users can also select which columns to search, and even use keyboard syntax shortcuts to quickly change the search behavior directly from the search input. Advanced Search is fully integrated with Preset Views, User Views, and Quick Filters. Advanced Search is currently in beta. To use the feature you’ll need to update your composer.json file to:
 "archilex/filament-filter-sets": “^4.2@beta”
Advanced Search is disabled by default. To enable, add advancedSearchEnabled() to your panel provider:
AdvancedTablesPlugin::make()
    ->advancedSearchEnabled()
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. Once enabled, the search field will display a settings button (gear icon) next to the search input. Clicking this button opens a dropdown with the following options:
  1. Search method - A dropdown to select the search constraint (e.g., Contains, Starts with, Matches).
  2. Search columns - Checkboxes to select which columns to include in the search. Only displayed when there are two or more searchable columns.
An information icon next to the search method dropdown displays a tooltip with all available search shortcuts.

Search Constraints

Advanced Search includes eight search constraints:
ConstraintDescriptionSQL Operator
ContainsMatches records containing the search term anywherelike %value%
Does not containExcludes records containing the search termnot like %value%
MatchesMatches records where the value is exactly the search term= value
Does not matchExcludes records where the value is exactly the search term!= value
Starts withMatches records starting with the search termlike value%
Does not start withExcludes records starting with the search termnot like value%
Ends withMatches records ending with the search termlike %value
Does not end withExcludes records ending with the search termnot like %value

Search Shortcuts

Instead of using the dropdown, users can type a syntax prefix directly in the search field to quickly change the search constraint:
ShortcutConstraintExample
(none)Containsorder
-Does not contain-order
=Matches=order
-=Does not match-=order
^Starts with^order
-^Does not start with-^order
$Ends with$order
-$Does not end with-$order
Tip: The information icon next to the search method dropdown displays all available shortcuts for quick reference.
Wrap your search term in quotes to match the full phrase. For example, "John Doe" will match records containing the exact phrase “John Doe” rather than matching “John” and “Doe” separately.

Using with Preset Views

You can apply default search settings to your Preset Views using the defaultSearch() method:
'active_orders' => PresetView::make('Active Orders')
    ->defaultSearch('pending')
You may also specify a search constraint and specific columns:
'active_orders' => PresetView::make('Active Orders')
    ->defaultSearch('pending', SearchConstraint::StartsWith, ['status', 'name'])
The defaultSearch() method accepts the following parameters:
ParameterTypeDescription
$searchstring | Closure | nullThe search term
$constraintstring | SearchConstraint | Closure | nullThe search constraint (e.g., 'starts_with', SearchConstraint::StartsWith)
$columnsarray | Closure | nullAn array of column names to search

Using with User Views

Advanced Search settings are automatically saved and restored with User Views. When a user saves a User View, the active search term, search constraint, and selected columns 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:
class ListOrders extends ListRecords
{
    use AdvancedTables;

    public static function advancedSearchIsEnabled(): bool
    {
        return false;
    }
    ...

Customizing the trigger action

You can customize the Advanced Search trigger button using advancedSearchTriggerAction(), following the same pattern as Filament’s trigger action customization:
use Filament\Actions\Action;

AdvancedTablesPlugin::make()
    ->advancedSearchTriggerAction(function (Action $action) {
        return $action
            ->icon('heroicon-s-magnifying-glass')
            ->tooltip('Search options')
            ->color('primary');
    })

Customizing the buttons and 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.