How to make tenant available to render hooks?

I’m currently building a plugin which allows users to register navigation items for a custom menu in the panel. When creating a tenant by clicking on the tenant register link, I get an error saying the tenant parameter is missing for navigation items registered in the panel using my plugin. It would be very helpful to know how I can go about fixing this. I have already done so much work on this plugin. Thanks.
Solution:
Solution was to do this in the resources/views/vendor/filament-panels/components/user-menu.blade.php view around the render hook: ```php @php $hasTenant = filament()->getTenant() !== null; @endphp...
Jump to solution
1 Reply
Solution
Andrew Wallo
Andrew Wallo3mo ago
Solution was to do this in the resources/views/vendor/filament-panels/components/user-menu.blade.php view around the render hook:
@php
$hasTenant = filament()->getTenant() !== null;
@endphp


@if($hasTenant)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::USER_MENU_BEFORE) }}
@endif
@php
$hasTenant = filament()->getTenant() !== null;
@endphp


@if($hasTenant)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::USER_MENU_BEFORE) }}
@endif