hidden filter on table

Hello, I have two menus which points on User model : "Customer" and "Professional". I created a resource named ClientResource who has to retrieve User with "is_customer = 1" and ProfessionalResource who has to retrieve those with "is_professional = 1". How to filter by default, hidden and not modifiable on table ? I can't find any way to do this in the doc Thank you
2 Replies
Kenneth Sese
Kenneth Sese14mo ago
You can try::
$table
->modifyQueryUsing(fn (Builder $query) => $query->where('is_professional', 1))
$table
->modifyQueryUsing(fn (Builder $query) => $query->where('is_professional', 1))
https://filamentphp.com/docs/3.x/panels/resources/listing-records#customizing-the-table-eloquent-query
SheepBild
SheepBildOP14mo ago
Nice thank you !
Want results from more Discord servers?
Add your server