{{ $totalApplications }}
{{ $pendingCount }}
{{ $rejectedCount }}
{{ $approvedCount }}
| # | Application Number | Applicant Name | Applicant Gender | Service | Window | Type | Officer | Status | Date |
|---|---|---|---|---|---|---|---|---|---|
| {{ ($applications->currentPage() - 1) * $applications->perPage() + $index + 1 }} | APP-{{ str_pad($application->id, 6, '0', STR_PAD_LEFT) }} | @if ($application->user && $application->user->name) @php $applicantName = is_array($application->user->name) ? $application->user->name[app()->getLocale()] ?? ($application->user->name['en'] ?? current($application->user->name)) : $application->user->name; @endphp {{ $applicantName }} @else N/A @endif | @if ($application->user && $application->user->gender) {{ ucfirst($application->user->gender) }} @else N/A @endif | @if ($application->service && $application->service->name) @php $serviceName = is_array($application->service->name) ? $application->service->name[app()->getLocale()] ?? ($application->service->name['en'] ?? current($application->service->name)) : $application->service->name; @endphp {{ $serviceName }} @else N/A @endif | @if ($application->service && $application->service->window && $application->service->window->name) @php $windowName = is_array($application->service->window->name) ? $application->service->window->name[app()->getLocale()] ?? ($application->service->window->name['en'] ?? current($application->service->window->name)) : $application->service->window->name; @endphp {{ $windowName }} @else N/A @endif | {{ ucfirst($application->apply_type) }} | @php $officers = $application->service->users ?? collect(); // Filter officers explicitly (in case we didn’t restrict in query) $officers = $officers->filter(fn($u) => $u->role_id == 3); // Extract readable localized names $officerNames = $officers->map(function ($officer) { if (is_array($officer->name)) { return $officer->name[app()->getLocale()] ?? ($officer->name['en'] ?? current($officer->name)); } return $officer->name; }); @endphp @if ($officerNames->isNotEmpty()) {{ $officerNames->join(', ') }} @else N/A @endif | {{ ucfirst($application->status) }} | {{ $application->created_at->format('M d, Y') }} |
|
No applications found for the selected filters. Try adjusting your filter criteria or check if there are applications in the database. |
|||||||||