How to get current tenant in FilamentServiceProvider?

Hi guys, I want to dynamicaly set some NavigationItems based on current tenant. So I need to register them in service provider, but I am not sure, how to access current tenant, becuase this is not working:
    public function panel(Panel $panel): Panel
    {
        $stores = Filament::getTenant()->stores;

        return $panel
            ->navigationItems(
                $stores->map(function (Store $store): NavigationItem {
                    return NavigationItem::make($store->name)
                        ->url(StoreResource::getUrl('view', ['record' => $store]))
                        ->parentItem(__('Stores'));
                })->toArray(),
            );
    }
Was this page helpful?