@php $customer = Auth::guard('customer')->user(); $hasProfilePicture = $customer->docpath && Storage::disk('public')->exists($customer->docpath); $profilePictureUrl = $hasProfilePicture ? asset('storage/' . $customer->docpath) : 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=500&q=60'; // Status colors $statusColor = match($application->status) { 'submitted' => ['bg' => 'blue', 'text' => 'blue', 'icon' => 'clock'], 'under_review' => ['bg' => 'yellow', 'text' => 'yellow', 'icon' => 'search'], 'approved' => ['bg' => 'green', 'text' => 'green', 'icon' => 'check-circle'], 'rejected' => ['bg' => 'red', 'text' => 'red', 'icon' => 'times-circle'], 'disbursed' => ['bg' => 'purple', 'text' => 'purple', 'icon' => 'money-bill-wave'], 'withdrawn' => ['bg' => 'gray', 'text' => 'gray', 'icon' => 'undo'], default => ['bg' => 'gray', 'text' => 'gray', 'icon' => 'file'] }; $progress = $progress ?? $this->calculateApplicationProgress($application); @endphp

Application Details

Application #{{ $application->application_number }}

{{ $application->product->product ?? 'Loan Application' }}

Application #{{ $application->application_number }}

{{ $statusText ?? ucfirst(str_replace('_', ' ', $application->status)) }} Applied {{ \Carbon\Carbon::parse($application->created_at)->format('F d, Y') }}
ZMW {{ number_format($application->loan_amount, 2) }}
{{ $application->loan_tenure }} months • {{ $application->interest_rate }}% interest
Monthly: ZMW {{ number_format($application->estimated_monthly_payment, 2) }}
Application Progress {{ $progress }}% Complete
Submitted Under Review Approved Completed

Applicant Details

Full Name
{{ $application->customer->full_name ?? $application->customer->customer }}
Email
{{ $application->customer->email }}
Phone
{{ $application->customer->phone }}
NRC Number
{{ $application->customer->number ?? 'N/A' }}
Address
{{ $application->customer->address }}, {{ $application->customer->town }}

Employment Details

Job Title
{{ $application->job_title ?? 'N/A' }}
Employer
{{ $application->employer_name ?? 'N/A' }}
Employment Type
{{ ucfirst($application->employment_type) ?? 'N/A' }}
Years in Employment
{{ $application->employment_years ?? 'N/A' }} years
Gross Salary
ZMW {{ number_format($application->gross_salary, 2) }}
Net Salary
ZMW {{ number_format($application->net_salary, 2) }}

Loan Details

Loan Product
{{ $application->product->product ?? 'N/A' }}
Loan Amount
ZMW {{ number_format($application->loan_amount, 2) }}
Loan Tenure
{{ $application->loan_tenure }} months
Interest Rate
{{ $application->interest_rate }}%
Monthly Payment
ZMW {{ number_format($application->estimated_monthly_payment, 2) }}
Total Repayment
ZMW {{ number_format($application->estimated_monthly_payment * $application->loan_tenure, 2) }}

Next of Kin

Full Name
{{ $application->kin_first_name }} {{ $application->kin_surname }}
Telephone
{{ $application->kin_telephone }}
Email
{{ $application->kin_email ?? 'N/A' }}
Address
{{ $application->kin_physical_address }}
Town/Province
{{ $application->kin_town }}, {{ $application->kin_province }}

Loan Purpose

{{ $application->loan_purpose }}

Application Documents

{{ $application->documents->count() }} document(s)
@if($application->documents->count() > 0)
@foreach($application->documents as $document)
@php $fileExt = strtolower(pathinfo($document->file_name, PATHINFO_EXTENSION)); $icon = match($fileExt) { 'pdf' => 'fa-file-pdf', 'doc', 'docx' => 'fa-file-word', 'jpg', 'jpeg', 'png', 'gif' => 'fa-file-image', 'xls', 'xlsx', 'csv' => 'fa-file-excel', default => 'fa-file' }; @endphp

{{ $document->file_name }}

{{ $document->getFormattedFileSizeAttribute() }} {{ strtoupper($fileExt) }} {{ ucfirst($document->status) }}

Uploaded: {{ $document->uploaded_at->format('M d, Y H:i') }}

@endforeach
@else

No Documents Uploaded

No documents were uploaded with this application.

The document upload feature was added after this application was submitted.

@endif
@if(in_array($application->status, ['draft', 'submitted']))
@csrf
@endif