F
Filamentβ€’15mo ago
anuwebroot

Role Filter

How to role wise filter in filament ->filters([ Tables\Filters\Filter::make('Manager') ->query(fn (Builder $query): Builder => $query->hasRole('manager')) ])
3 Replies
Dennis Koch
Dennis Kochβ€’15mo ago
Please provide some more information. What is not working?
anuwebroot
anuwebrootOPβ€’15mo ago
I've added role wise filter but it's not working.
->filters([
Tables\Filters\Filter::make('Manager')
->query(fn (Builder $query): Builder => $query->hasRole('manager'))
])
->filters([
Tables\Filters\Filter::make('Manager')
->query(fn (Builder $query): Builder => $query->hasRole('manager'))
])
No description
Dennis Koch
Dennis Kochβ€’15mo ago
So if you have an error, why didn't you share it in your first message? πŸ™ˆ Well, seems like hasRole() doesn't exist. Where did you get it from? We don't know your code base, so we can't make assumptions.
Want results from more Discord servers?
Add your server