{{-- resources/views/probation/cases/_supervision_ledger.blade.php Central Supervision Ledger entry for this case. The row preview is exactly how the case appears in the ledger; the form captures the columns the case does not already hold (all others come from the Case Ledger fields above, Supervision and Completion). --}} @php $ledgerKey = \App\Support\SupervisionLedger::forCaseType($case->case_type); @endphp @if($ledgerKey && $ledgerKey !== 'referrals') @php $row = \App\Support\SupervisionLedger::row($case, $ledgerKey); $columns = \App\Support\SupervisionLedger::columns($ledgerKey); $flat = []; foreach ($columns as [$label, $spec]) { if (is_array($spec)) { foreach ($spec as [$sl, $sk]) $flat[] = [$label . ' – ' . $sl, $sk]; } else { $flat[] = [$label, $spec]; } } $first = $case->supervisionOrders->sortBy('start_date')->first(); $latest = $case->supervisionOrders->sortByDesc('id')->first(); $ymd = fn ($d) => $d ? \Carbon\Carbon::parse($d)->format('Y-m-d') : ''; $h = $case->hostelResidency; $title = \App\Support\SupervisionLedger::LEDGERS[$ledgerKey][1]; @endphp
| {{ $lbl }} | {{ $val === '' || $val === null ? 'N/A' : $val }} | @endforeach
|---|