© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•17mo ago•
16 replies
zemo

What is the best way to conditionally hide a tab in the ListResource page?

I have a resource called SubjectResource, where I have a number of tabs and each of it modifies the query in a certain way. Based on the user role, I need to hide most of the tabs.

How do I accomplish that? I have installed the plugin "Shield" to handle roles.

Thank you!
Solution
->extraAttributes(['style' => auth()->user()->can('view_this') ? '' : 'display: none;'])
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

conditionally hide relation page
FilamentFFilament / ❓┊help
3y ago
Is there a way to hide a page?
FilamentFFilament / ❓┊help
3y ago
Is there a way to conditionally hide the Tenant Registration Link in the Tenant Menu?
FilamentFFilament / ❓┊help
3y ago
Conditionally hide a section
FilamentFFilament / ❓┊help
3y ago