#How to use different logos for the login and the sidebar ?

11 messages · Page 1 of 1 (latest)

stuck hedge
#

When I set brandLogo in config it applies the same logo. I'd like to use two versions of the brand logo with differents size : one for the login page and one for the sidebar. Any idea? Thanks

velvet gladeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

shut onyx
#

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

stuck hedge
#

It's working

velvet gladeBOT
soft pagoda
#

Hi @stuck hedge What was the code you used here? The attached file is a binary that I cannot view

thorny sonnet
#

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.

proven trail
#

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);
    }
}
thorny sonnet
#

Neat 🙂 TIL. In my case I am doing other dark magic muahahahaha