Hi I want to change my panel appearance based on currently active tenant! But I'm facing a problem!

public function panel(Panel $panel): Panel { $appearance = Appearance::whereBelongsTo(Filament::getTenant()); return $panel ->id('shop') ->path('shop') ->login() ->colors([ 'danger' => Color::Rose, 'gray' => Color::Slate, 'info' => Color::Blue, 'primary' => Color::Teal, 'success' => Color::Emerald, 'warning' => Color::Orange, ]) its showing this error Call to a member function newCollection() on null In this step I think filament didn't know what is my current tenant maybe panel isn't initialized yet!! so are there any way to set appearance for my tenant panel ?
Solution:
The tenant is identified through a middleware so cannot access it inside a ServiceProvider. Create a middleware, use Filament::getCurrentPanel() to get the panel and then apply your changes.
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch5mo ago
The tenant is identified through a middleware so cannot access it inside a ServiceProvider. Create a middleware, use Filament::getCurrentPanel() to get the panel and then apply your changes.
Nick Ruddra
Nick RuddraOP5mo ago
thanks for your help sir!
Want results from more Discord servers?
Add your server