Does configureUsing work on Filament\Panel?

I'm using a logo on my panel which works fine if I set it in the panel() method of the PanelProvider. But since i'm going to want the same on every panel, I'm trying to set them in a global Service Provider. To keep things separate, I created a new provider and added this:
public function boot(): void
{
Panel::configureUsing(function (Panel $panel) {
return $panel
->brandLogo(asset('img/hrlink-logo.svg'))
->darkModeBrandLogo(asset('img/hrlink-logo-light.svg'));
}, isImportant: TRUE
);
}
public function boot(): void
{
Panel::configureUsing(function (Panel $panel) {
return $panel
->brandLogo(asset('img/hrlink-logo.svg'))
->darkModeBrandLogo(asset('img/hrlink-logo-light.svg'));
}, isImportant: TRUE
);
}
I initially tried it without the isImportant but saw that mentioned elsewhere so I gave it a shot. No joy. I've also tried it in AppServiceProvider just to rule out any problems with the new one but same result. I also added a log line at the top of the boot() method to verify that it's getting called and it is. Multiple times. Any thoughts on why the config is not being picked up?
Solution:
Probably the AppServiceProvider is already too late because the panel is configured in a ServiceProvider too. Can you try this in register() method?
Jump to solution
5 Replies
Dennis Koch
Dennis Koch5mo ago
Is the callback even called?
phydeaux
phydeauxOP5mo ago
Nope. It's just ignoring it. But Panel uses Configurable so I would think it should at least go into the closure even if it didn't apply anything.
Solution
Dennis Koch
Dennis Koch5mo ago
Probably the AppServiceProvider is already too late because the panel is configured in a ServiceProvider too. Can you try this in register() method?
phydeaux
phydeauxOP5mo ago
Winner winner! That was it. I feel stupid that that didn't occur to me. Really appreciate the help.
gizmojo
gizmojo4mo ago
Cheers guys just came here attempting the same thing
Want results from more Discord servers?
Add your server