File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
resources/views/filament/components Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11@php
2+ use Illuminate\Database\Eloquent\ Model ;
3+
24 $currentTenant = filament ()-> getTenant ();
3- $currentTenantName = filament ()-> getTenantName ($currentTenant );
5+ $currentTenantName = $currentTenant ? filament ()-> getTenantName ($currentTenant ) : null ;
46
5- $canSwitchTenants = count (
7+ $canSwitchTenants = $currentTenant ? count (
68 $tenants = array_filter (
79 filament ()-> getUserTenants (filament ()-> auth ()-> user ()),
8- fn (\ Illuminate \ Database \ Eloquent \ Model $tenant ): bool => ! $tenant -> is ($currentTenant ),
10+ fn (Model $tenant ): bool => $tenant && ! $tenant -> is ($currentTenant ),
911 ),
10- );
12+ ) : 0 ;
1113@endphp
14+ @if ($currentTenant )
1215<x-filament::dropdown placement =" bottom-start" size teleport >
1316 <x-slot name =" trigger" >
1417 <button type =" button"
@@ -23,11 +26,14 @@ class="ms-auto h-5 w-5 shrink-0 text-gray-400 transition duration-75 group-hover
2326 @if ($canSwitchTenants )
2427 <x-filament::dropdown .list >
2528 @foreach ($tenants as $tenant )
29+ @if ($tenant )
2630 <x-filament::dropdown .list.item :href =" route('filament.admin.pages.dashboard', ['tenant' => $tenant])" :image =" filament()->getTenantAvatarUrl($tenant)" tag =" a" >
2731 {{ filament ()-> getTenantName ($tenant ) } }
2832 </x-filament::dropdown .list.item >
33+ @endif
2934 @endforeach
3035 </x-filament::dropdown .list >
3136 @endif
3237
3338</x-filament::dropdown >
39+ @endif
You can’t perform that action at this time.
0 commit comments