F
Filament12mo ago
Nays

Disable Topbar

Hi! I find no way of removing the topbar or any documentation about it. but i would like an option supposedly on the panelprovider like ->topPanel(false) which would wrap the x-filament-panels::topbar component in the filament layout/index.php with that if statement. or if anyone have a more sophisticated way of achieving that. And then one would also need to move the profil navigation, which i also would want to move to the end of the sidebar, but that'll have to be another card, but it would be needed aswell i guess
3 Replies
Helge Sverre
Helge Sverre12mo ago
I believe you can copy the "vendor/filament/filament/resources/views/components/layout/index.blade.php" into your resources/views/vendors/filament/components/layout/index.blade.php" and remove <x-filament-panels::topbar :navigation="$navigation" /> and add register <x-filament-panels::user-menu /> to be injected into : \Filament\Support\Facades\FilamentView::renderHook('panels::sidebar.nav.start') or \Filament\Support\Facades\FilamentView::renderHook('panels::sidebar.nav.end') like this: Filament::registerRenderHook( 'panels::sidebar.nav.end', static fn (): View => view('filament.hooks.no-website-selected'), ); you might have to make a custom view that simply outputs <x-filament-panels::user-menu /> and reference that view in the renderhook registration. unsure if that will work without any problems, but that is how i would attempt to do it. Filament::registerRenderHook can be called from AppServiceProvide::boot()
Nays
NaysOP12mo ago
Yhea i found that solution with the render hooks for the panel user menu aswell, I wrapped it in a livewire object and added it to nav.end. But the overwriting the index file from the vendor isn’t that advised against in the docs?
Helge Sverre
Helge Sverre12mo ago
sure, but sometimes what is advised in the docs is incompatible with the desired outcome 😛
Want results from more Discord servers?
Add your server