{{-- Residency tab Hostel: vacancy request → approval → availability → confirmation · admission · stay · exit / transfer Halfway: application (form upload) → accept / decline · admission · stay (incl. breach of house rules) · exit / transfer Borstal: vacancy request → approval → institution feedback → confirmation --}} @php $isHalfway = $residency === 'halfway_house'; $isBorstal = $residency === 'borstal'; $vStatus = config('probation_workflow.vacancy_statuses'); $canApprove = auth()->user()->isSuperAdmin() || auth()->user()->isBranchAdmin(); $res = $isHalfway ? $case->halfwayResidency : ($isBorstal ? null : $case->hostelResidency); $vacancies = $isBorstal ? $case->borstalVacancies : $case->hostelVacancies; $badge = ['requested' => 'bg-warning text-dark', 'approved' => 'bg-info text-dark', 'available' => 'bg-success', 'not_available' => 'bg-danger', 'confirmed' => 'bg-primary', 'applied' => 'bg-warning text-dark', 'accepted' => 'bg-success', 'declined' => 'bg-danger']; $ymd = fn ($d) => $d ? \Carbon\Carbon::parse($d)->format('Y-m-d') : ''; @endphp
No application yet.
@endforelse @elseNo vacancy request yet.
@endforelse @endifExited {{ \Carbon\Carbon::parse($res->exit_date)->format('d M Y') }} · {{ ucfirst($res->status) }}
@if($res->items_returned)Items returned: {{ $res->items_returned }}
@endif @else @endif