@php use App\Enums\DocumentType; use App\Enums\VisaEntryType; $chevronSvg = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8fa8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"; $inp = 'w-full rounded-[8px] border border-[#dde0ec] bg-white px-3 py-[10px] text-[13px] text-ui-ink outline-none transition-colors placeholder:text-ui-muted focus:border-ui-gold focus:ring-[3px] focus:ring-[rgba(232,133,10,0.08)] disabled:cursor-not-allowed disabled:bg-slate-50 disabled:text-slate-400'; $sel = "w-full cursor-pointer appearance-none rounded-[8px] border border-[#dde0ec] bg-white bg-no-repeat px-3 py-[10px] pr-8 text-[13px] text-ui-ink outline-none transition-colors focus:border-ui-gold focus:ring-[3px] focus:ring-[rgba(232,133,10,0.08)] disabled:cursor-not-allowed disabled:bg-slate-50"; $lbl = 'block text-[12px] font-semibold text-[#3a3f5a]'; $sectionCard = 'rounded-[12px] border border-[#e8eaf0] bg-white p-6'; $sectionTitle = 'mb-[18px] text-[14px] font-bold text-ui-ink'; $fileInputClass = 'block w-full text-[11px] text-ui-muted ' .'file:mr-2 file:rounded-[7px] file:border file:border-[#dde0ec] ' .'file:bg-white file:px-3 file:py-1.5 file:text-[11px] ' .'file:font-semibold file:text-[#3a3f5a] file:cursor-pointer ' .'hover:file:border-ui-gold hover:file:text-ui-gold'; $fixedDocSlots = [ ['key' => 'passport', 'property' => 'file_passport', 'type' => DocumentType::Passport, 'label' => 'Passport', 'icon' => 'fa-passport', 'required' => true], ['key' => 'id_card', 'property' => 'file_id_card', 'type' => DocumentType::IdCard, 'label' => 'ID card', 'icon' => 'fa-id-card', 'required' => true], ['key' => 'picture', 'property' => 'file_picture', 'type' => DocumentType::Picture, 'label' => 'Picture', 'icon' => 'fa-user-circle', 'required' => true], ['key' => 'non_criminal', 'property' => 'file_non_criminal', 'type' => DocumentType::NonCriminalCertificate, 'label' => 'Non-criminal certificate', 'icon' => 'fa-file-shield', 'required' => true], ['key' => 'previous_visa', 'property' => 'file_previous_visa', 'type' => DocumentType::PreviousVisa, 'label' => 'Previous visa', 'icon' => 'fa-stamp', 'required' => false], ]; $nationalityOptions = config('nationalities.names', []); if (! empty($applicationModel?->nationality) && ! in_array($applicationModel->nationality, $nationalityOptions, true)) { $nationalityOptions = array_values(array_unique(array_merge([$applicationModel->nationality], $nationalityOptions))); sort($nationalityOptions); } @endphp
{{-- Flash banners --}} @if (session('status') === 'submitted')
Application submitted. Editing is now locked.
@endif @if (session('status') === 'details-saved')
Application details saved.
@endif @if ($isAdminContext ?? false)
You are editing as admin. Changes are saved on behalf of the customer. Use Save changes to update fields; use Submit application to mark the application as submitted (same as customer submit).
@elseif ($isAgentContext ?? false)
@if ($applicationModel && $applicationModel->user_id === null) This case is filed under your agent account only—there is no applicant portal login. Enter the traveler’s details and documents below; our admins will see that you created this application. @else You are submitting this application for a linked customer. Complete the form and required documents, then submit. The customer can see the application on their account after you submit it. @endif
@endif @error('documents')
{{ $message }}
@enderror @php($visaDocs = $applicationModel?->documents?->where('type', \App\Enums\DocumentType::Visa)->values() ?? collect()) @php($visaNote = trim((string) ($applicationModel?->visa_note ?? ''))) @if ($visaDocs->isNotEmpty() || $visaNote !== '')
@if ($visaDocs->isNotEmpty()) Documents from admin ({{ $visaDocs->count() }}) @else Note from admin @endif

@if ($visaDocs->isNotEmpty()) The admin has shared {{ $visaDocs->count() === 1 ? 'a file' : 'files' }} with you. Please review {{ $visaDocs->count() === 1 ? 'it' : 'them' }} below. @else The admin has left you a note about your application. @endif

@if ($visaNote !== '')
Note from admin

{{ $visaNote }}

@endif @if ($visaDocs->isNotEmpty())
    @foreach ($visaDocs as $doc)
  • {{ $doc->custom_label ?: basename($doc->file_path) }} View
  • @endforeach
@endif
@endif {{-- ── PERSONAL INFORMATION ─────────────────────────────────────── --}}
Personal Information
{{-- Row 1: full name · passport · dob · nationality --}}
@error('full_name')

{{ $message }}

@enderror
@error('passport_number')

{{ $message }}

@enderror
@error('dob')

{{ $message }}

@enderror
@error('nationality')

{{ $message }}

@enderror
{{-- FORM_VERSION: 2026-06-04-entry --}}
@error('visa_type')

{{ $message }}

@enderror
@error('visa_duration')

{{ $message }}

@enderror
@error('entry_type')

{{ $message }}

@enderror
@error('marital_status')

{{ $message }}

@enderror
@error('qualification')

{{ $message }}

@enderror

Saved as: {{ $contact_dial_code }}{{ preg_replace('/\D+/', '', (string) $contact_local_number) }}

@error('contact_number')

{{ $message }}

@enderror
@if ($isAdminContext ?? false)
@error('contact_reference')

{{ $message }}

@enderror
@endif
{{-- ── FAMILY DETAILS ───────────────────────────────────────────── --}}
Family Details
@error('father_name')

{{ $message }}

@enderror
@error('mother_name')

{{ $message }}

@enderror
@error('wife_name')

{{ $message }}

@enderror
{{-- ── UPLOAD DOCUMENTS ─────────────────────────────────────────── --}} @if (! empty($applicationModel))
Upload Documents
@if (session('doc-status') === 'uploaded')
File uploaded successfully.
@endif

PDF / JPG / PNG, max 5 MB each

{{-- Fixed slots --}} @foreach ($fixedDocSlots as $slot) @php($docsOfType = $applicationModel->documents->where('type', $slot['type'])) @php($has = $docsOfType->isNotEmpty())

{{ $slot['label'] }}

@if ($has)
Uploaded
@foreach ($docsOfType as $doc) @if (! ($locked ?? false)) @endif @endforeach
@else @if (! ($locked ?? false))

{{ $slot['required'] ? 'Required' : 'Optional' }}

@error($slot['property'])

{{ $message }}

@enderror
Uploading…
@else

@endif @endif
@endforeach {{-- Existing "Other" custom-labeled docs --}} @foreach ($applicationModel->documents->where('type', \App\Enums\DocumentType::Other) as $doc)

{{ $doc->custom_label ?: 'Other document' }}

Uploaded
@if (! ($locked ?? false)) @endif
@endforeach {{-- Add More Document --}} @if (! ($locked ?? false))
@error('custom_label')

{{ $message }}

@enderror @if ($file)
Selected
@if (method_exists($file, 'getClientOriginalName'))

{{ $file->getClientOriginalName() }}

@endif @else

Optional

@endif @error('file')

{{ $message }}

@enderror
Uploading…
@endif
@if ($locked ?? false)

Document uploads are locked once an application is submitted.

@endif
@endif {{-- ── SUBMIT / LOCKED / ADMIN ─────────────────────────────────── --}} @if ($isAdminContext ?? false)
@if (! ($applicationModel?->is_submitted ?? false))

Submit marks the application as submitted for the customer. Required-document checks can be skipped when submitting from the admin panel.

@else

Already submitted — the customer cannot edit their side. You can still save changes here to correct details or documents.

@endif
@elseif (! ($locked ?? false))

Note: Once submitted, you cannot change or edit any information.

@else
This application has been submitted and can no longer be edited.
@endif