@php $user = auth()->user(); $userInitial = $user?->name ? strtoupper(mb_substr($user->name, 0, 1)) : 'U'; $profilePhotoUrl = $user?->profile_photo_path ? asset('storage/' . $user->profile_photo_path) : null; $unreadNotificationsCount = $user ? $user->unreadNotifications()->count() : 0; $recentNotifications = $user ? $user->notifications()->latest()->limit(6)->get() : collect(); @endphp
@yield('title', 'Dashboard')

Selamat datang kembali, {{ $user?->name ?? 'Admin' }}!

@if ($profilePhotoUrl) Foto Profil @else {{ $userInitial }} @endif

{{ $user?->name ?? 'Tamu' }}

{{ $user?->role ?? '-' }}

@yield('content')
@yield('scripts')