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?
D
dyo39d ago
anyone can help me?
M
morty39d ago
What doesn't work? What is the query that is generated?
D
dyo39d ago
thanks for your response.. let me explain more the first image or case, the user try to search the phone number using from whatsapp number contact whatsapp the second image or case, user try to search the phone number in the form of exactly like in the database. I want the first case to also return the data..
No description
No description
D
dyo39d ago
i've tried debugging with this, still no result
Tables\Columns\TextColumn::make('hp')
->searchable(query: function (Builder $query, string $search): Builder {
// $search = ConvertPhone::nomor($search);
$search = 628880778033;

// return $query->where('hp', 'like', "%$search%");
return $query->where('hp', $search);
})
Tables\Columns\TextColumn::make('hp')
->searchable(query: function (Builder $query, string $search): Builder {
// $search = ConvertPhone::nomor($search);
$search = 628880778033;

// return $query->where('hp', 'like', "%$search%");
return $query->where('hp', $search);
})
Want results from more Discord servers?
Add your server
More Posts
Save relationship first before creating modelSo I need to save the relationship first then create a model and sync itCalculate Totals in the footer for a table componentHow can calculate the total balance of the customers and show it in the footer .Note this table compFilter using columnsHello, I'm having difficulty creating a filter in a query that I inserted in the columns. How can I Hiring a senior mobile app developer from India or PakistanI have some mobile projects. I want someone have over 3 years experience. And especially I hope reacGet current row record in custom action```php Tables\Actions\Action::make('make_additional_payment') ->label('Наплати дSelect multiple preloaded options are reordered after selecting the inputI have a select multiple that is formFilled with options already attached on a BelongsToMany relatioError on trying to edit or create a new role at SHIELD pluginIm getting ```count(): Argument #1 ($value) must be of type Countable|array, null given``` this errotesting repeater / fillForm / fill default itemHi - I'm just getting started writing tests for my app with Pest. My first and most high-traffic resUse fa-icon in table builderI'm working in a project who already have a database in production. The database have a table with aIs there a difference between these two `Auth::user()` vs `Filament::auth()->user()`?Is there anytime where using one or the other is beneficial?larazeus popover pop under table header/footerHello, having a problem, when i add a popover in a table, it's showing under the tablefooter/header.Laravel Breeze and filamentHi everyone, i use filament for the admin panel that is registered on /admin, then i have an api end