@extends('layouts.admin') @section('title','Application List') @section('content')
| # | Application No | Applicant Name | Type of Relief | Status | Days Since Submission | Action |
|---|---|---|---|---|---|---|
| {{ $applications->firstItem() + $key }} | {{-- show application_number if present, else fallback to id --}}{{ $app->application_number ?? $app->id }} | {{-- applicant alias -> user name (safe) --}}{{ optional($app->applicant)->name ?? $app->name ?? '-' }} | {{-- display readable application type if relation present --}} {{-- Type of Relief (from application_types.application_type_name) --}}{{ optional($app->applicationType)->application_type_name ?? $app->application_type_id ?? '-' }} | @php $statusText = optional($app->ApplicationStatus)->status_name ?? $app->status ?? '-'; $badgeClass = match($statusText) { 'Approved' => 'bg-success', 'Pending' => 'bg-warning text-dark', 'Rejected' => 'bg-danger', 'Returned' => 'bg-secondary', 'Disbursed' => 'bg-info text-dark', default => 'bg-light text-dark', }; @endphp {{ $statusText }} | {{ $app->days_since_submission }} days | View |
| No applications found. | ||||||