@extends('layouts.app') @section('content')

Notifications @if($unreadCount > 0) {{ $unreadCount }} @endif

@if($unreadCount > 0) Mark All as Read @endif
Reset
@if($notifications->count() > 0)
@foreach($notifications as $notification)
@if(!$notification->is_read) NEW @endif
{{ $notification->title }}

{{ Str::limit($notification->message, 120) }}

{{ $notification->created_at->diffForHumans() }} {{ $notification->enquiry->check_number ?? 'N/A' }} @if($notification->enquiry) {{ Str::limit($notification->enquiry->full_name, 25) }} {{ $notification->enquiry->region->name ?? 'N/A' }}, {{ $notification->enquiry->district->name ?? 'N/A' }} @endif
@php $typeColors = [ 'enquiry_registered' => 'info', 'enquiry_assigned' => 'primary', 'status_changed' => 'warning', 'payment_initiated' => 'info', 'payment_approved' => 'success', 'payment_rejected' => 'danger', 'payment_paid' => 'success', 'loan_processed' => 'info', 'loan_approved' => 'success', 'loan_rejected' => 'danger', ]; $color = $typeColors[$notification->type] ?? 'secondary'; @endphp {{ ucwords(str_replace('_', ' ', $notification->type)) }}
@if($notification->enquiry) View Enquiry @endif Full Details @if(!$notification->is_read)
@csrf
@endif
@endforeach
{{ $notifications->links() }}
@else
No notifications found

You're all caught up!

@endif
@push('styles') @endpush @endsection