@extends('layouts.app') @section('title', 'Applications') @push('styles') @endpush @section('content') @php $role = auth()->user()?->role; $isAdmin = $role === 'admin'; $isReviewer = $role === 'user'; $isApplicant = $role === 'applicant'; @endphp
{{-- ── HEADER ── --}}

Applications

Ministry of Fisheries & Ocean Resources — Local Fish Licensing System

{{-- ── TOOLBAR ── --}}
{{ $isApplicant ? 'My Applications' : 'All Applications' }} ({{ $applications->total() }} total)
{{-- ── SUCCESS / ERROR FLASH ── --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- ── STATUS FILTER (admin & reviewer only) ── --}} @if($isAdmin || $isReviewer)
@if(request()->hasAny(['status','license_type','search'])) Clear @endif
@endif {{-- ── TABLE ── --}}
@if($isAdmin || $isReviewer) @endif @forelse($applications as $app) @php $showRoute = match($role) { 'admin' => route('admin.applications.show', $app), 'user' => route('reviewer.applications.show', $app), default => route('applicant.applications.show', $app), }; $badgeClass = match($app->status) { 'approved' => 'badge-approved', 'rejected' => 'badge-rejected', 'reviewing' => 'badge-reviewing', 'draft' => 'badge-draft', default => 'badge-pending', }; @endphp {{-- ID --}} {{-- Applicant --}} {{-- Company --}} {{-- License type --}} {{-- Status --}} {{-- Reviewer (admin/reviewer only) --}} @if($isAdmin || $isReviewer) @endif {{-- Submitted --}} {{-- View --}} @empty @endforelse
# Applicant Company License Type StatusReviewerSubmitted
#{{ $app->id }}
{{ $app->ap_full_name ?? $app->user?->name ?? '—' }}
{{ $app->ap_email ?? $app->user?->email ?? '' }}
{{ $app->cd_business_name ?? $app->cd_registered_name ?? '—' }}
{{ ucfirst($app->cd_company_type ?? '') }}
{{ ucfirst($app->license_type ?? '—') }} {{ ucfirst($app->status ?? 'pending') }} {{ $app->reviewer?->name ?? '—' }} {{ $app->created_at?->format('d M Y') ?? '—' }}

No applications found.

{{-- ── PAGINATION ── --}} @if($applications->hasPages())
{{ $applications->links() }}
@endif
{{-- /.invoice-card --}}
{{-- /.invoice-wrap --}}
{{-- /.invoice-page --}} @endsection