FilamentF
Filament2y ago
Liam

Get tenant on a custom NavigationItem

Hello,

I want to add a custom NavigationItem where I need to redirect users to a page in my app outside of Filament, I want to include the tenant id they are currently on with:

NavigationItem::make(__('Abonnementen'))
                    ->url(request()->get('tenant'))
                    ->icon('heroicon-o-credit-card'),


Filament::getTenant() doesn't work and request()->get('tenant'), doesn't work as well.
Solution
I guess you need to use a Closure for url then ->url(fn () => ...)
Was this page helpful?