{{-- resources/views/notifications/index.blade.php --}} @extends('layouts.app') @section('title', 'Notifications') @section('page_title', 'Notifications') @section('page_subtitle', 'Templates and delivery overview') @section('content') {{-- Stats --}}
{{ $stats['sent_today'] }}
Sent Today
{{ $stats['failed_today'] }}
Failed Today
{{ $stats['sent_month'] }}
Sent This Month
{{ $stats['pending'] }}
Pending
{{-- Templates --}}
Notification Templates Edit Templates
@if($templates->isEmpty())

No templates configured

Set up templates in Settings → Notifications

Configure Notifications
@else @php $channelColors = [ 'email' => ['bg'=>'#dbeafe','color'=>'#1e40af','icon'=>'bi-envelope'], 'sms' => ['bg'=>'#d1fae5','color'=>'#065f46','icon'=>'bi-chat-dots'], 'whatsapp' => ['bg'=>'#dcfce7','color'=>'#166534','icon'=>'bi-whatsapp'], ]; $eventLabels = [ 'welcome' => 'Welcome', 'reservation_confirmed' => 'Reservation Confirmed', 'check_in_reminder' => 'Check-in Reminder', 'check_out_reminder' => 'Check-out Reminder', 'payment_received' => 'Payment Received', 'invoice_issued' => 'Invoice Issued', 'reservation_cancelled' => 'Reservation Cancelled', 'balance_due_reminder' => 'Balance Due Reminder', 'subscription_expiring' => 'Subscription Expiring', ]; @endphp
@foreach($templates as $event => $channelTemplates)
{{ $eventLabels[$event] ?? ucfirst(str_replace('_', ' ', $event)) }}
@foreach($channelTemplates as $tpl) @php $cc = $channelColors[$tpl->channel] ?? $channelColors['email']; @endphp {{ ucfirst($tpl->channel) }} @if(!$tpl->is_active) (off) @endif @endforeach
{{-- Send manually --}} @php $firstActive = $channelTemplates->where('is_active', true)->first(); @endphp @if($firstActive) @endif
@endforeach
@endif
{{-- Recent Log --}}
Recent Activity Full log →
@if($recentLogs->isEmpty())

No notifications sent yet

@else
@foreach($recentLogs as $log) @php $cc = $channelColors[$log->channel] ?? $channelColors['email']; $sc = [ 'sent' => ['color'=>'var(--success)','icon'=>'bi-check-circle-fill'], 'failed' => ['color'=>'var(--danger)', 'icon'=>'bi-x-circle-fill'], 'pending' => ['color'=>'var(--warning)', 'icon'=>'bi-hourglass-split'], 'queued' => ['color'=>'var(--info)', 'icon'=>'bi-clock'], ][$log->status] ?? ['color'=>'var(--muted)','icon'=>'bi-dash-circle']; @endphp
{{ $log->guest?->first_name }} {{ $log->guest?->last_name ?? $log->recipient }}
{{ ucfirst(str_replace('_', ' ', $log->event)) }}
{{ $log->created_at->diffForHumans() }}
@endforeach
@endif
{{-- Send Manually Modal --}} @endsection @push('scripts') @endpush