@php $userRole = auth()->user()->roles->first()->name ?? 'user'; @endphp
{{--
@yield('title')
--}}
{{-- Notification Bell --}}
@php $unreadCount = \App\Models\Notification::where('user_id', auth()->id()) ->where('is_read', false) ->count(); @endphp @if ($unreadCount > 0)
{{ $unreadCount > 99 ? '99+' : $unreadCount }}
unread notifications
@endif
Notifications
Mark all read
@php $notifications = \App\Models\Notification::where('user_id', auth()->id()) ->latest() ->limit(5) ->get(); @endphp @forelse($notifications as $notification)
{{ $notification->message }}
{{ $notification->created_at->diffForHumans() }}
@empty
No notifications
@endforelse @if ($notifications->count() >= 5)
View all
@endif
{{-- User Dropdown --}}
{{ Auth::user()->name }}
Signed in as
{{ Auth::user()->name }}
My Profile
Activity Logs
@csrf
Logout
@yield('content')
@stack('scripts')