@extends('layouts.app') @section('title', 'Notifications') @section('page-title', 'Notifications') @section('content')
@if(session('success'))
{{ session('success') }}
@endif {{-- Actions --}}

{{ auth()->user()->unreadNotifications->count() }} unread notification(s)

@if(auth()->user()->unreadNotifications->count() > 0)
@csrf
@endif @if($notifications->total() > 0)
@csrf @method('DELETE')
@endif
{{-- Notification List --}} @forelse($notifications as $notification) @php $data = $notification->data; $colorMap = [ 'red' => 'bg-red-50 border-red-200 text-red-600', 'green' => 'bg-green-50 border-green-200 text-green-600', 'blue' => 'bg-blue-50 border-blue-200 text-blue-600', 'yellow' => 'bg-yellow-50 border-yellow-200 text-yellow-600', 'orange' => 'bg-orange-50 border-orange-200 text-orange-600', ]; $iconColor = $colorMap[$data['color'] ?? 'blue'] ?? $colorMap['blue']; $isUnread = $notification->read_at === null; @endphp
{{-- Icon --}}
{{-- Content --}}

{{ $data['title'] ?? 'Notification' }}

{{ $data['message'] ?? '' }}

@if(!empty($data['remarks']))

"{{ $data['remarks'] }}"

@endif
{{ $notification->created_at->diffForHumans() }}
{{-- Actions --}}
@if($isUnread)
@csrf @method('PATCH')
@else Read @endif
@csrf @method('DELETE')
@empty

No notifications yet.

You'll see attendance alerts, leave updates, and fee reminders here.

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