Total Notifikasi
@extends('layouts.admin') @section('title', 'Notifikasi | Admin Rental') @section('page_title', 'Notifikasi') @push('styles') @endpush @section('content') @php $currentItems = $notifications->getCollection(); $statusFilter = request('status', 'all'); $typeFilter = request('type'); $search = request('search'); $totalNotifications = $notifications->total(); $unreadCountOnPage = $currentItems->whereNull('read_at')->count(); $readCountOnPage = $currentItems->whereNotNull('read_at')->count(); $todayCountOnPage = $currentItems->filter(function ($item) { return optional($item->created_at)->isToday(); })->count(); $filteredNotifications = $currentItems->filter(function ($item) use ($search, $typeFilter) { $normalizedType = strtolower(trim((string) ($item->type ?? 'system'))); $searchText = strtolower(trim((string) $search)); $haystack = strtolower((string) (($item->title ?? '') . ' ' . ($item->message ?? ''))); $matchesType = !$typeFilter || $typeFilter === '' || str_contains($normalizedType, strtolower((string) $typeFilter)); $matchesSearch = $searchText === '' || str_contains($haystack, $searchText); return $matchesType && $matchesSearch; }); $iconByType = function (?string $type): string { return match (strtolower((string) $type)) { 'booking', 'booking_new', 'new_booking' => 'bi-journal-text', 'payment', 'payment_uploaded', 'payment_verified', 'payment_rejected' => 'bi-credit-card-2-front', 'review', 'review_new' => 'bi-chat-left-text', 'promo', 'promo_active', 'promo_expired' => 'bi-megaphone', 'warning' => 'bi-exclamation-triangle', 'error' => 'bi-x-octagon', 'success' => 'bi-check-circle', default => 'bi-bell', }; }; $badgeTypeClass = function (?string $type): string { return match (strtolower((string) $type)) { 'booking', 'booking_new', 'new_booking' => 'is-booking', 'payment', 'payment_uploaded', 'payment_verified', 'payment_rejected' => 'is-payment', 'review', 'review_new' => 'is-review', 'promo', 'promo_active', 'promo_expired' => 'is-promo', 'warning' => 'is-warning', 'error' => 'is-error', 'success' => 'is-success', default => 'is-system', }; }; $typeLabel = function (?string $type): string { $raw = strtolower(trim((string) $type)); if ($raw === '') { return 'System'; } return ucwords(str_replace(['_', '-'], ' ', $raw)); }; @endphp
{{ $message }}
{{ $message }}
{{ $message }}
{{ $message }}
Pantau pembaruan penting terkait booking, pembayaran, dan aktivitas rental Anda.
Total Notifikasi
Belum Dibaca (Halaman Ini)
Sudah Dibaca (Halaman Ini)
Notifikasi Hari Ini
Tidak ada notifikasi yang cocok dengan filter saat ini.
Notifikasi terkait aktivitas rental Anda akan muncul di halaman ini.