FilamentF
Filament9mo ago
Joshua

Side Nav vs Top Nav per user?

I know this seems like an odd request but is there any way or plugin to basically toggle if its side nav or tap nav on a per user basis like a dark/light theme preference?
Solution
You can store the preference in a session and use a middleware to handle this..

public function handle(Request $request, Closure $next): Response
{
    $currentPanel = filament()->getCurrentPanel();

    if (...) {
        $currentPanel->topNavigation();
    }

    return $next($request);
}


Add the middleware in your panel $panel->middleware([CustomMiddleware:class])
Was this page helpful?