@php $isAdmin = auth()->check() && in_array(auth()->user()->role, ['admin', 'superadmin'], true); $urgentHospitalSubmitted = false; if (isset($fund) && $fund->fund_type === 'urgent') { $latestUrgentCaseId = $recipient->urgentCases()->latest('case_id')->value('case_id'); if ($latestUrgentCaseId) { $urgentHospitalSubmitted = \App\Models\UrgentLog::where('case_id', $latestUrgentCaseId) ->where('status', 'hospital_submitted') ->exists(); } } @endphp
Application decision
Recipient: {{ $recipient->first_name }} {{ $recipient->second_name }} {{ $recipient->third_name }} {{ $recipient->last_name }}
Recipient ID: {{ $recipient->id }}
Fund type: {{ ucfirst($fund->fund_type) }}
Current fund status: {{ ucfirst($fund->fstatus) }}
Medical description
{{ $recipient->description ?: '—' }}
@if($fund->fstatus === 'rejected' && $fund->rejection_reason)
Current rejection reason
{{ $fund->rejection_reason }}
@endif
@if(!$isAdmin)
Unauthorized.
@else @if($fund->fund_type === 'urgent')
@if($urgentHospitalSubmitted)
Approve application
@csrf
@endif
Reject application
@csrf
@error('rejection_reason')
{{ $message }}
@enderror
@else
Refer to medical council
@csrf
@error('medical_council_appointment_at')
{{ $message }}
@enderror
@error('medical_council_appointment_location')
{{ $message }}
@enderror
@error('initial_review_notes')
{{ $message }}
@enderror
Reject application
@csrf
@error('rejection_reason')
{{ $message }}
@enderror
@endif @endif