© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
F
Filament
•
2y ago
•
4 replies
Wirkhof
How to grab user's roles in Filament?
I am using Filament Shield and I have assigned a role
panel_role
panel_role
to a user
.
I want to limit the visibility of a certain form field based on the role of the current user
.
For a specific user id
(in this case if the user has id 39
)
, this works
:
->visible(fn () => auth()->id() === 39)
->visible(fn () => auth()->id() === 39)
And only the user with id 39 sees that form field
.
But how to do a condition targeting user
's role
?
how would the visible method look like in that case
? Let
's say for the
panel_role
panel_role
?
Solution
Solved it myself
Jump to solution
Filament
Join
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
how to show roles in user table
F
Filament / ❓┊help
3y ago
How to scope filament-shield roles
F
Filament / ❓┊help
6mo ago
Filament DateTimePicker: How to show default time in user's local timezone?
F
Filament / ❓┊help
8mo ago