@php $currentTenant = filament()->getTenant(); $currentTenantName = filament()->getTenantName($currentTenant); $items = filament()->getTenantMenuItems(); $billingItem = $items['billing'] ?? null; $billingItemUrl = $billingItem?->getUrl(); $isBillingItemVisible = $billingItem?->isVisible() ?? true; $hasBillingItem = (filament()->hasTenantBilling() || filled($billingItemUrl)) && $isBillingItemVisible; $registrationItem = $items['register'] ?? null; $registrationItemUrl = $registrationItem?->getUrl(); $isRegistrationItemVisible = $registrationItem?->isVisible() ?? true; $hasRegistrationItem = ((filament()->hasTenantRegistration() && filament()->getTenantRegistrationPage()::canView()) || filled($registrationItemUrl)) && $isRegistrationItemVisible; $profileItem = $items['profile'] ?? null; $profileItemUrl = $profileItem?->getUrl(); $isProfileItemVisible = $profileItem?->isVisible() ?? true; $hasProfileItem = ((filament()->hasTenantProfile() && filament()->getTenantProfilePage()::canView($currentTenant)) || filled($profileItemUrl)) && $isProfileItemVisible; $canSwitchTenants = count($tenants = array_filter( filament()->getUserTenants(filament()->auth()->user()), fn (\Illuminate\Database\Eloquent\Model $tenant): bool => ! $tenant->is($currentTenant), )); $items = \Illuminate\Support\Arr::except($items, ['billing', 'profile', 'register']); @endphp {{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TENANT_MENU_BEFORE) }} @if ($hasProfileItem || $hasBillingItem) @if ($hasProfileItem) {{ $profileItem?->getLabel() ?? filament()->getTenantProfilePage()::getLabel() }} @endif @if ($hasBillingItem) {{ $billingItem?->getLabel() ?? __('filament-panels::layout.actions.billing.label') }} @endif @endif @if (count($items)) @foreach ($items as $item) @php $itemPostAction = $item->getPostAction(); @endphp {{ $item->getLabel() }} @endforeach @endif @if ($canSwitchTenants) @foreach ($tenants as $tenant) {{ filament()->getTenantName($tenant) }} @endforeach @endif @if ($hasRegistrationItem) {{ $registrationItem?->getLabel() ?? filament()->getTenantRegistrationPage()::getLabel() }} @endif {{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TENANT_MENU_AFTER) }}