Show navigation and topbar conditionally
In my panel provider I am disabling the navigation and topbar like this:
Since I actually only want to do this for specific roles, I wonder if there is a way to set this conditionally?
This does not seem to be working:
7 Replies
You can maybe try doing it in a listener.
Hmm.. I am not sure how to use listeners for this in filament
I think filament has some events that are sent when the panel is booted or something
Do you mean the render hooks?
GitHub
filament/packages/panels/src/Events at 3.x · filamentphp/filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Those events
You can even dispatch a custom event inside a middleware
Panels require either the default navigation or the top navigation. Of which you control the visibility of resources/items via policies. If you don’t want either then you need a custom layout. Which is going to be more trouble than it’s probably worth, but it can be done.