@include('Partials.sidebar')
@include('Partials.header')
{{-- Page title --}}

Notifications

All notifications sent to frontend users

  1. โ€บ
  2. Notifications
{{-- Flash --}} @foreach(['success','error'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach {{-- Stat cards --}}
@foreach([ ['label'=>'Total Sent', 'value'=>$stats['total'], 'color'=>'#6c757d', 'icon'=>'fa-paper-plane'], ['label'=>'Unread', 'value'=>$stats['unread'], 'color'=>'#f59e0b', 'icon'=>'fa-envelope'], ['label'=>'Read', 'value'=>$stats['read'], 'color'=>'#22c55e', 'icon'=>'fa-envelope-open'], ] as $c)
{{ $c['label'] }}
{{ $c['value'] }}
@endforeach
{{-- Left: notifications list --}}
{{-- Filters --}}
@if($stats['read'] > 0) @csrf @method('DELETE')
@endif
{{-- Notifications list --}}
{{ $notifications->total() }} Notifications
@forelse($notifications as $notif) @php $typeColors = [ 'payment_reminder' => '#f59e0b', 'booking_confirmed' => '#22c55e', 'booking_cancelled' => '#ef4444', 'general' => '#6c757d', ]; $typeIcons = [ 'payment_reminder' => 'fa-credit-card', 'booking_confirmed' => 'fa-check-circle', 'booking_cancelled' => 'fa-times-circle', 'general' => 'fa-bell', ]; $color = $typeColors[$notif->type] ?? '#6c757d'; $icon = $typeIcons[$notif->type] ?? 'fa-bell'; @endphp
{{-- Icon --}}
{{-- Content --}}
{{ $notif->title }} @if(!$notif->is_read) Unread @endif
{{ $notif->message }}
@if($notif->user) {{ $notif->user->name }} ยท {{ $notif->user->email }} @endif @if($notif->booking) Unit {{ $notif->booking->plot_number }} @endif {{ $notif->created_at->diffForHumans() }} @if($notif->is_read && $notif->read_at) Read {{ $notif->read_at->diffForHumans() }} @endif
{{-- Delete --}}
@csrf @method('DELETE')
{{-- Unread dot --}} @if(!$notif->is_read)
@endif
@empty
No notifications found.
@endforelse
@if($notifications->hasPages()) @endif
{{-- Right: Send custom notification --}}
Send Notification
@csrf
{{-- Booking selector โ€” shown for payment_reminder & booking types --}}
Use {name} for user's name, {unit} for unit number.
{{-- Template preview badge --}}
@include('Partials.footer')