{{-- THEME --}} {{-- ===================================================== --}} {{-- NOTIFICATION --}} {{-- ===================================================== --}} @php $unreadCount = Auth::user() ->unreadNotifications() ->count(); $notifications = Auth::user() ->notifications() ->latest() ->take(5) ->get(); @endphp
{{-- DROPDOWN NOTIFICATION --}}
{{-- HEADER --}}
Notifications
@if($unreadCount > 0) {{ $unreadCount }} belum dibaca @else Semua sudah dibaca @endif
@if($unreadCount > 0)
@csrf
@endif
{{-- DAFTAR NOTIFIKASI --}}
@forelse($notifications as $notification) @php $data = $notification->data; $icon = $data['icon'] ?? 'bi-bell'; $jenis = $data['jenis'] ?? 'info'; if ($jenis === 'warning') { $iconClass = 'text-warning'; } elseif ($jenis === 'success') { $iconClass = 'text-success'; } else { $iconClass = 'text-primary'; } @endphp
{{-- ICON --}}
{{-- ISI NOTIFIKASI --}}
{{ $data['judul'] ?? 'Notifikasi' }} {{-- LABEL BARU --}} @if(is_null($notification->read_at)) Baru @endif
{{-- PESAN --}}
{{ $data['pesan'] ?? '' }}
{{-- WAKTU + AKSI --}}
{{ $notification->created_at->diffForHumans() }} {{-- LIHAT --}} @if(!empty($data['url'])) Lihat @endif {{-- TANDAI DIBACA --}} @if(is_null($notification->read_at))
@csrf
@endif
@empty {{-- BELUM ADA NOTIFIKASI --}}

Belum ada notifikasi

@endforelse
{{-- FOOTER --}}
Lihat semua notifikasi
{{-- ===================================================== --}} {{-- PROFILE --}} {{-- ===================================================== --}}
  • Profil
  • Pengaturan Akun

  • @csrf