You can override the static indexQuery in your resource to adjust the search
public static function indexQuery
{
if (!request()->filled('filters')) {
return $query->whereNull('downloaded_at');
}
return $query;
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Right now my app only has 2 resources I want searched. Both resources will need to search an email column that is encrypted. I currently use something like this to find the records since they are encrypted:
Consumer::all()->filter(function ($record) use ($email) {
if ($record->email == $email) {
return $record;
}
});
How can I adjust the how "search" is done? Its a must for the app per the client, but so is encrypting PII. I should be able to use that same chunk of code if I knew where to overwrite how to search
Please or to participate in this conversation.