$role = 'student'; if ($user->hasRole('admin') || $user->hasRole('super-admin')) $role = 'admin'; elseif ($user->hasRole('teacher')) $role = 'teacher'; elseif ($user->hasRole('parent')) $role = 'parent'; $dashboardRoute = match($role) { 'admin' => '/admin/dashboard', 'teacher' => '/teacher/dashboard', 'parent' => '/parent/dashboard', default => '/student/dashboard', }; $typeIcons = [ 'academic' => ['icon' => '📚', 'color' => 'blue'], 'finance' => ['icon' => '💳', 'color' => 'emerald'], 'session' => ['icon' => '🎥', 'color' => 'purple'], 'goal' => ['icon' => '🎯', 'color' => 'amber'], 'community' => ['icon' => '👥', 'color' => 'rose'], 'system' => ['icon' => '⚙️', 'color' => 'slate'], 'message' => ['icon' => '💬', 'color' => 'indigo'], 'ops' => ['icon' => '🏆', 'color' => 'yellow'], ]; $unreadCount = $notifications->where('is_read', false)->count(); @endphp

🔔 {{ __('Notification Center') }} @if($unreadCount > 0) {{ $unreadCount }} @endif

{{ __('Your notifications and alerts') }}

{{-- Notifications List --}}
@forelse($notifications as $notif) @php $meta = $typeIcons[$notif->type] ?? ['icon' => '🔔', 'color' => 'primary']; @endphp
{{ $meta['icon'] }}

{{ $notif->title }}

{{ $notif->body }}

{{ $notif->created_at->diffForHumans() }} @if($notif->action_url) View → @endif
@unless($notif->is_read) @endunless
@empty
🔔

{{ __('No notifications') }}

{{ __("You're all caught up!") }}

@endforelse
{{-- Pagination --}} @if($notifications->hasPages())
{{ $notifications->links() }}
@endif