@extends('layouts.admin') @section('title','Application List') @section('content')

Registrar - Application List

{{-- Filter Form --}}
{{-- NOTE: name changed to application_number to match controller/model --}}
{{-- Applications Table --}}
@forelse ($applications as $key => $app) {{-- show application_number if present, else fallback to id --}} {{-- applicant alias -> user name (safe) --}} {{-- display readable application type if relation present --}} {{-- Type of Relief (from application_types.application_type_name) --}} @empty @endforelse
# Application No Applicant Name Type of Relief Status Days Since Submission Action
{{ $applications->firstItem() + $key }}{{ $app->application_number ?? $app->id }}{{ optional($app->applicant)->name ?? $app->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.
{{-- Pagination --}}
{{ $applications->links() }}
@endsection