$shouldRegisterNavigation on CreateRecord

Hello,

How can i make my CreateRecord from resourse to use $shouldRegisterNavigation so I can add a custom navigation item ?

I've tried addming in my AdminPanelProvider:

NavigationItem::make('Add product')
                    ->url(fn () => CreateProduct::getUrl())
                    ->icon('heroicon-o-plus-circle')
                    ->group('Products')
                    ->visible(function() {
                        // here i need to check current user permissions
                    })
                    ->sort(-1),


I'm using mutlti tenants so i need to be able to check current user permissions on the visible() method of the navigation item but unfortunately, seems Filament::getTenant() is not available at that point it comes null

Any suggestions?
Was this page helpful?