#How to use different logos for the login and the sidebar ?
11 messages · Page 1 of 1 (latest)
You can pass a closure to the brandLogo so I guess you should be able to differentiate between login page and other pages using request/url
Thank you for marking this question as solved!
Hi @stuck hedge What was the code you used here? The attached file is a binary that I cannot view
You can customize any of the filament views by copying them into your resources folder. For example I am messing with the login page here:
You should be able to put different logos where ever you like via this method.
No need to override views. It’s generally not recommended.
Just create a regular view and tell the panel where to find it with ->brandLogo(fn () => view('filament.admin.logo'))
Then in the view you can do something like this:
@if (is_panel_auth_route())
@svg('icon-ccf-centered-white', 'h-12 w-auto lg:h-16 mb-6')
@else
@svg('icon-ccf-favicon', 'h-8 w-8')
@endif
My panel auth check looks like this. Tailor to your needs.
if (! function_exists('is_panel_auth_route')) {
function is_panel_auth_route(): bool
{
$authRoutes = [
'/login',
'/password-reset',
'/register',
'/email-verification',
];
return Str::of(Request::path())->contains($authRoutes);
}
}
Neat 🙂 TIL. In my case I am doing other dark magic muahahahaha