© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
8 replies
Eric

How to use Laravel Scout in Global Search?

https://filamentphp.com/docs/3.x/tables/advanced#searching-records-with-laravel-scout
https://filamentphp.com/docs/4.x/tables/overview#searching-records-with-laravel-scout

So lets say i have a songs resource.

in the list songs i have:
protected function applySearchToTableQuery(Builder $query): Builder
{
    $this->applyColumnSearchesToTableQuery($query);

    if (filled($search = $this->getTableSearch())) {
        $query->whereIn('songs.id', Song::search($search)->keys());
    }

    return $query;
}
protected function applySearchToTableQuery(Builder $query): Builder
{
    $this->applyColumnSearchesToTableQuery($query);

    if (filled($search = $this->getTableSearch())) {
        $query->whereIn('songs.id', Song::search($search)->keys());
    }

    return $query;
}


then, in the table search input, i make a search with a typo. it works.

but then, in the global search, it just doesnt work.

yeah, in the song resource i added ->searchable and also in the model i defined the toSearchableArray properly

is possible to integrate laravel scout in global search without plugins?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Global Search & Laravel Scout
FilamentFFilament / ❓┊help
3y ago
Laravel Scout for Specific search column
FilamentFFilament / ❓┊help
3y ago
Use Accessor in Global Search
FilamentFFilament / ❓┊help
3y ago
How to search for ListX in global search?
FilamentFFilament / ❓┊help
3y ago