{{-- Probation dashboard: analytics by station / county / region / national, case status overview, pending approvals and alerts. --}} @extends('layouts.app') @section('title', 'Probation Dashboard - ICMIS') @push('styles') @include('probation._styles') @endpush @section('content') @php $max = max(1, $byType->max() ?? 1); $statusMax = max(1, collect($statusOverview)->max() ?? 1); @endphp

Probation & Aftercare Dashboard

@include('probation.dashboard._filters')
Total cases

{{ $total }}

in scope
Returned

{{ $returned }}

need revision
Conference requests

{{ $confRequests }}

awaiting approval
Breaches

{{ $openBreaches }}

reported
Case status overview
@forelse($statusOverview as $label => $n)
{{ $label }}{{ $n }}
@empty

No cases.

@endforelse
Cases by module
@forelse($byType as $t => $n)
{{ $types[$t] ?? $t }}{{ $n }}
@empty

No cases.

@endforelse
Alerts{{ $alerts->count() }}
@forelse($alerts->take(60) as $a)  {{ $a['case']->serial_number }} {{ optional($a['case']->prisoner)->name }}
{{ $a['text'] }}
@empty

No alerts.

@endforelse
By station
@foreach($types as $t => $l)@endforeach @forelse($byStation as $bid => $counts) @php $b = $branches[$bid] ?? null; @endphp @foreach($types as $t => $l)@endforeach @empty@endforelse
StationCountyRegion{{ $l }}Total
{{ optional($b)->branch_name ?? '—' }}{{ optional($b)->county ?? '—' }}{{ optional($b)->region ?? '—' }}{{ $counts[$t] ?? 0 }}{{ $counts->sum() }}
No data.
Recently registered
@foreach($recent as $c) @endforeach
{{ $c->serial_number }} {{ optional($c->prisoner)->name }}{{ $types[$c->case_type] ?? $c->case_type }} {{ optional($c->officer)->name ?? 'Unassigned' }}{{ $c->status_label }}{{ $c->created_at->format('d M Y') }}
@endsection