GL
GL
FFilament
Created by GL on 10/3/2024 in #❓┊help
How to completely override the search query for Select while also using relationship?
Seems i found the solution by looking at the source code of Select. When you provide an empty array to searchable it won't apply the automatic LIKE due to no columns defined. This Select won't apply the LIKE in final db query Select::make('authors') ->native(false) ->searchable([]) ->multiple() ->relationship( name: 'authors', titleAttribute: 'name', modifyQueryUsing: fn (Builder $query, ?string $search) => $query ->when($search, fn ($q) => $q->whereFullText(['name'], $search, ['mode' => 'boolean'])) ->orderByDesc('views') ) ->searchDebounce(300)
8 replies
FFilament
Created by GL on 10/3/2024 in #❓┊help
How to completely override the search query for Select while also using relationship?
While searchable does have the query it does not resolve the actual search term.
8 replies