© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
dyo

problem with customized searchable text column

https://filamentphp.com/docs/2.x/tables/columns/getting-started#searching

Does anyone know the correct way to custom the results from searchable in textcolumn?

So in this case, there is a cellphone column whose example data format is 6285265213796

but admin users often search for cellphone number data in the format of the results from copying and pasting numbers on WA, for example +62 852 6521 3796

I've tried

Tables\Columns\TextColumn::make('phone')
     ->searchable(query: function (Builder $query, string $search): Builder {
         return $query->where('phone', ConvertPhone::number($search));
     })
Tables\Columns\TextColumn::make('phone')
     ->searchable(query: function (Builder $query, string $search): Builder {
         return $query->where('phone', ConvertPhone::number($search));
     })


The classes and methods above are also used in other cases, and convert the cellphone number format correctly, according to the data in the database.

but when used in textcolumn, the script above doesn't work as expected.
What should I do?
Getting started - Table Builder - Filament
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

Searchable column with scoped model
FilamentFFilament / ❓┊help
8mo ago
Searchable translatable column
FilamentFFilament / ❓┊help
2y ago
Problem with Reactive Searchable Select
FilamentFFilament / ❓┊help
3y ago
searchable in id column
FilamentFFilament / ❓┊help
3y ago