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!
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;'])