@php use Illuminate\Support\Facades\Auth; use Filament\Facades\Filament; // Safely get navigation try { $navigation = Filament::getNavigation(); } catch (\Throwable $e) { $navigation = []; } $user = Auth::user(); $userName = $user?->name ?? 'Admin'; $userInitial = strtoupper(substr($userName, 0, 1)); // Safe logo URL — fall back gracefully if no image exists try { $adminLogo = \App\Models\Setting::getValue('admin_logo'); $logoUrl = $adminLogo ? asset('storage/' . $adminLogo) : null; } catch (\Throwable $e) { $logoUrl = null; } // Safe profile URL try { $profileUrl = \App\Filament\Pages\Auth\EditProfile::getUrl(); } catch (\Throwable $e) { $profileUrl = '#'; } @endphp