@section('page-title', 'Notifikasi') @section('page-subtitle', 'Daftar semua notifikasi')
Semua Notifikasi
@if($notifications->where('read_at', null)->count() > 0)
@csrf
@endif
@forelse($notifications as $notification)
@php $iconData = match($notification->type) { 'disposisi' => ['icon' => 'bi-arrow-right-circle-fill text-primary', 'bg' => 'rgba(45,80,22,0.08)'], 'surat_masuk' => ['icon' => 'bi-inbox-fill text-success', 'bg' => 'rgba(5,150,105,0.08)'], 'surat_keluar' => ['icon' => 'bi-send-fill text-info', 'bg' => 'rgba(37,99,235,0.08)'], 'warning' => ['icon' => 'bi-exclamation-triangle-fill text-warning', 'bg' => 'rgba(217,119,6,0.08)'], 'error' => ['icon' => 'bi-x-circle-fill text-danger', 'bg' => 'rgba(220,53,69,0.08)'], default => ['icon' => 'bi-bell-fill text-kopassus', 'bg' => 'rgba(184,151,90,0.08)'], }; @endphp
{{ $notification->title }} @if(!$notification->read_at) Baru @endif

{{ $notification->message }}

{{ $notification->created_at->diffForHumans() }}
@php $notifData = $notification->data ?? null; if (is_string($notifData)) { $decoded = json_decode($notifData, true); if (is_string($decoded)) { $decoded = json_decode($decoded, true); } $notifData = $decoded ?: []; } elseif (!is_array($notifData)) { $notifData = []; } $actionUrl = null; if (!empty($notifData['disposisi_id'])) { $actionUrl = route('disposisi.show', $notifData['disposisi_id']); } elseif (!empty($notifData['surat_masuk_id'])) { $actionUrl = route('surat-masuk.show', $notifData['surat_masuk_id']); } elseif (!empty($notifData['surat_keluar_workflow_id'])) { $actionUrl = route('surat-keluar-workflow.show', $notifData['surat_keluar_workflow_id']); } elseif (!empty($notifData['surat_keluar_id'])) { $actionUrl = route('surat-keluar-workflow.show', $notifData['surat_keluar_id']); } @endphp @if($actionUrl) Lihat @endif @if(!$notification->read_at)
@csrf
@endif
@csrf @method('DELETE')
@empty

Tidak ada notifikasi

Semua notifikasi sudah dibaca atau belum ada notifikasi baru.
@endforelse
@if(($pagination->totalPages ?? 1) > 1) @endif