Searchable columns not working with applySearchToTableQuery
Hi guys I am facing an issue when using
So I can either search with
I am having Order with many Tickets (hasMany) and I want into the OrderResource to search by order id, name, email, etc... but also to modify the search query to search the tickets by their first_name, last_name and email.
->searchable() on columns in the resource table but when using the applySearchToTableQuery function into ListRecords class then the searchable columns are not included and the query doesn't work right.So I can either search with
->searchable() or with the applySearchToTableQuery function.I am having Order with many Tickets (hasMany) and I want into the OrderResource to search by order id, name, email, etc... but also to modify the search query to search the tickets by their first_name, last_name and email.
- Filament version:
"filament/filament": "3.2.2", - ListRecords applySearchToTableQuery```php protected function applySearchToTableQuery(Builder $query): Builder { $this->applyColumnSearchesToTableQuery($query); if (filled($search = $this->getTableSearch())) { $like = '%'.$search.'%'; $query->whereIn('id', Ticket::select('order_id') ->whereAny([DB::raw("CONCAT(`first_name`, ' ', `last_name`)"), 'email'], 'like', $like) ); } return $query; }```
- OrderResource toggable columns