@php use App\Enums\DefaultUserRole; $user = auth()->user(); @endphp
@if($user?->hasRole(DefaultUserRole::Admin->value))

Admin Panel

@endif
@php $unreadNotifications = $user?->unreadNotifications()->take(5)->get() ?? collect(); $unreadCount = $user?->unreadNotifications()->count() ?? 0; @endphp
@if($unreadCount > 0) {{ $unreadCount }} @endif
@if($unreadNotifications->isEmpty()) @else
Notifications
@csrf
@foreach($unreadNotifications as $notification)
{{ data_get($notification->data, 'issue_category', 'Notification') }} {{ data_get($notification->data, 'message', '') }} {{ $notification->created_at->diffForHumans() }}
@endforeach @endif
{{ $user->initials() }}

{{$user->name}}

{{$user->email}}

@csrf