Search and global scope
Hi
I have a global scope on a resource so that user can only see record that belongs to the user.
In my Filament resource I have this:
but... it looks like the ->searchable() is not working
What did I miss?
Thanks
14 Replies
what do you mean searchable() is not working?
it does not find any records
e.g name is searchable, but even if I type in the name it's not found
is this on a table?
is the record in the table without the search applied?
yes
crap.... now i know
I use ChipperSweet to encrypt
Ouch
You'll need to modify the native search query to use whereBlind for instance
Just what I was about to ask.....
protected static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()->withoutGlobalScopes(); // TODO: Change the autogenerated stub
}
in there ?
No
see:
https://filamentphp.com/docs/2.x/tables/columns/getting-started#searching
You can pass it in searchable()
Filament
Getting started - Columns - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
then isIndividual could be a good one to add
Yep
hmmm %{$search}% does not seem to work.... need to do some research..
Thanks for the input
No problem!
@steen.rabol have you resolve this issue? i have exactly the same issue, would be great if you could share the solution if you already fixed.
In my specific case there is nt really a solution as the data is encryoted in the DB and therefor pr. definition one cannot search