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:
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->withoutGlobalScopes();
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->withoutGlobalScopes();
}
but... it looks like the ->searchable() is not working What did I miss? Thanks
14 Replies
Dan Harrin
Dan Harrin2y ago
what do you mean searchable() is not working?
rabol
rabolOP2y ago
it does not find any records e.g name is searchable, but even if I type in the name it's not found
Dan Harrin
Dan Harrin2y ago
is this on a table? is the record in the table without the search applied?
rabol
rabolOP2y ago
yes crap.... now i know I use ChipperSweet to encrypt
toeknee
toeknee2y ago
Ouch You'll need to modify the native search query to use whereBlind for instance
rabol
rabolOP2y ago
Just what I was about to ask..... protected static function getGlobalSearchEloquentQuery(): Builder { return parent::getGlobalSearchEloquentQuery()->withoutGlobalScopes(); // TODO: Change the autogenerated stub } in there ?
toeknee
toeknee2y ago
No
toeknee
toeknee2y ago
Filament
Getting started - Columns - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
rabol
rabolOP2y ago
then isIndividual could be a good one to add
toeknee
toeknee2y ago
Yep
rabol
rabolOP2y ago
hmmm %{$search}% does not seem to work.... need to do some research.. Thanks for the input
toeknee
toeknee2y ago
No problem!
kingtox
kingtox16mo ago
@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.
rabol
rabolOP16mo ago
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
Want results from more Discord servers?
Add your server