@extends('template.layouts.template-base') @section('title', 'Notification') @section('content')

Notifications

@csrf
@forelse($userNotifications as $dateLabel => $items)

{{ $dateLabel }}

@foreach ($items as $userNotif) @php $notif = $userNotif->notification; $isRead = $userNotif->is_read; @endphp
avatar
{{ optional($notif->sender)->name ?? 'System' }} {{ $notif->title }} @if (!$isRead) @endif

{{ $notif->body }}

@if ($notif->type === 'quotation_approval_request') @php $quotation = \App\Models\Quotation::find($notif->resource_id); @endphp @if ($quotation && $quotation->is_approved == 0 && $quotation->is_rejected == 0) {{-- Still pending — show button --}} @elseif($quotation && $quotation->is_approved == 1) {{-- Already approved — show badge --}} ✓ Approved @elseif($quotation && $quotation->is_rejected == 1) {{-- Already rejected — show badge --}} ✗ Rejected @endif @endif {{-- USER: Approved status badge --}} @if ($notif->type === 'quotation_approved') ✓ Your quotation has been Approved @endif {{-- USER: Rejected status badge --}} @if ($notif->type === 'quotation_rejected') ✗ Your quotation has been Rejected @endif @if ($notif->type === 'client_approval_request') @php $record = \App\Models\Client::find($notif->resource_id); @endphp @if ($record && $record->is_approved == 0 && $record->is_rejected == 0) @elseif($record && $record->is_approved == 1) ✓ Approved @elseif($record && $record->is_rejected == 1) ✗ Rejected @endif @endif @if ($notif->type === 'client_approved') ✓ Your client request has been Approved @endif @if ($notif->type === 'client_rejected') ✗ Your client request has been Rejected @endif @if ($notif->type === 'product_approval_request') @php $record = \App\Models\Product::find($notif->resource_id); @endphp @if ($record && $record->is_approved == 0 && $record->is_rejected == 0) @elseif($record && $record->is_approved == 1) ✓ Approved @elseif($record && $record->is_rejected == 1) ✗ Rejected @endif @endif @if ($notif->type === 'product_approved') ✓ Your product request has been Approved @endif @if ($notif->type === 'product_rejected') ✗ Your product request has been Rejected @endif @if ($notif->type === 'quotation_followup_set') @endif @if ($notif->type === 'sales_followup_set') @endif @if ($notif->type === 'quotation_expiry') @endif @if ($notif->type === 'payment_due') @endif
{{ $userNotif->created_at->diffForHumans() }}
@endforeach
@empty

No notifications found.

@endforelse
@endsection @section('scripts') @endsection