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:Jump to 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.2 Replies
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.thanks for your help sir!