F
Filamentβ€’6d ago
Jamie Cee

User Menu to sidebar

Is it possible to move the user menu to the bottom of the sidebar without overriding the view blade? So sticky position to the sidebar navigation, and on show, so settings and logout buttons directly, without clicking into the user menu. Or would this be a case of disabling user menu then creating custom navigation actions?
Solution:
```php ->renderHook( PanelsRenderHook::SIDEBAR_FOOTER, fn (): View => view('filament-panels::components.user-menu', ['attributes' => new \Illuminate\View\ComponentAttributeBag]) )...
Jump to solution
13 Replies
toeknee
toekneeβ€’6d ago
You should be able to use a render hook the blade to add it to the bottom left.
Jamie Cee
Jamie CeeOPβ€’6d ago
Do I call the user menu render hook as the second param? Currently got
FilamentView::registerRenderHook(
PanelsRenderHook::SIDEBAR_FOOTER,
static fn() => view('filament-panels::components.user-menu'),
);
FilamentView::registerRenderHook(
PanelsRenderHook::SIDEBAR_FOOTER,
static fn() => view('filament-panels::components.user-menu'),
);
And getting: Undefined variable $attributes
Solution
toeknee
toekneeβ€’6d ago
->renderHook(
PanelsRenderHook::SIDEBAR_FOOTER,
fn (): View => view('filament-panels::components.user-menu', ['attributes' => new \Illuminate\View\ComponentAttributeBag])
)
->renderHook(
PanelsRenderHook::SIDEBAR_FOOTER,
fn (): View => view('filament-panels::components.user-menu', ['attributes' => new \Illuminate\View\ComponentAttributeBag])
)
Technically.. works
Jamie Cee
Jamie CeeOPβ€’5d ago
im guessing the technically, would be unadvisory?
toeknee
toekneeβ€’5d ago
Not at all, it just looked a bit funny on my display
Jamie Cee
Jamie CeeOPβ€’5d ago
Ah, fair haha Ill give it a go now, just got into work
Jamie Cee
Jamie CeeOPβ€’5d ago
Does your's still show as a dropdown? Is it possible to show already viewable, like this example
No description
toeknee
toekneeβ€’5d ago
So for that, just build your own view and render it there. Copy the bits from the current item and jobs good
Jamie Cee
Jamie CeeOPβ€’5d ago
Excellent. Thank you for your help πŸ™‚
Jamie Cee
Jamie CeeOPβ€’5d ago
Actually, another quick question if you don't mind. I added ->topbar(false) in my provider, supposing that removes the bar at the top? But seems to be ignored, so user menu items still exists there also
No description
toeknee
toekneeβ€’5d ago
Topbar false means it removes the topbar and addsa sidebar πŸ˜‰ If topbar = true, sidebar goes away
Jamie Cee
Jamie CeeOPβ€’5d ago
Ah, so that part with the search and user menu at the top, is different to ->topbar(), gotcha
toeknee
toekneeβ€’5d ago
Yep

Did you find this page helpful?