{{-- Supervision tab: PR 2 · PR 2A · Orders · Breaches · Treatment Plan (Tool C) · CPV · Comments & inspection · Monitoring & SMS --}} @php $triggers = config('probation_workflow.order_triggers'); $kindsI = config('probation_workflow.inspection_kinds'); $cpvUsers = \App\Models\User::where('branch_id', $case->branch_id)->orderBy('name')->get(['id', 'name', 'role']); $smsTpl = config('probation_workflow.sms.templates'); @endphp
@include('probation.cases._pr2', ['case' => $case])
@include('probation.cases._pr2a', ['case' => $case])
{{-- ORDERS --}}
Supervision orders
@forelse($case->supervisionOrders->sortBy('start_date') as $so)
{{ $triggers[$so->triggered_by] ?? ucwords(str_replace('_',' ',$so->triggered_by)) }} · Placed {{ optional($so->start_date)->format('d M Y') ?? '—' }} · Expected date of expiry {{ optional($so->end_date)->format('d M Y') ?? '—' }} @if($so->extension_to) · extended to {{ optional($so->extension_to)->format('d M Y') }}@endif {{ ucfirst($so->status) }}
@csrf
@empty

No supervision order yet — one is created automatically with the first PR 2A record, or add it below.

@endforelse
@csrf
New supervision order
Choose “Voluntary supervision” for clients supervised without a court order.
@csrf
Intensity of supervision
{{-- BREACHES --}}
Breaches & warrants
@forelse($case->breaches->sortByDesc('reported_on') as $b)
{{ optional($b->reported_on)->format('d M Y') }} — {{ $b->description }} {{ ucwords(str_replace('_',' ',$b->action ?? 'under review')) }}
Warrant applied: {{ optional($b->warrant_applied_on)->format('d M Y') ?? '—' }} @if($b->warrant_file_path) · Scanned warrant@endif
@csrf
@empty

No breaches reported.

@endforelse
@csrf
Report a breach → warning / warrant of arrest / discharge of order
@include('probation.cases._treatment_plan', ['case' => $case])
{{-- CPV --}}
Community Probation Volunteer (CPV)
@unless(auth()->user()->isCpv())
@csrf
A CPV user (role “cpv”) only sees the cases they are attached to, and can only add comments.
@endunless @forelse($case->cpvComments as $cm)
{{ $cm->comment }}
{{ optional($cm->user)->name }} · {{ optional($cm->visited_on)->format('d M Y') ?? $cm->created_at->format('d M Y') }}
@empty

No CPV comments yet.

@endforelse
@csrf
{{-- SUPERVISOR COMMENTS / INSPECTION, AGENCY & OFFICER COMMENTS --}}
Supervisor's comments, inspection & evaluation of work done
@forelse($case->inspections as $in)
{{ $kindsI[$in->kind] ?? $in->kind }} @if($in->level) · {{ ucfirst($in->level) }} level @endif · {{ optional($in->inspected_on)->format('d M Y') }} · {{ $in->by_name ?: optional($in->user)->name }} @if($in->rating){{ $in->rating }}@endif
{{ $in->findings }}
@if($in->recommendations)
Recommendations: {{ $in->recommendations }}
@endif
@empty

No comments or inspections yet.

@endforelse
@csrf
{{-- ELECTRONIC MONITORING & SMS --}}
Electronic (GPS) monitoring
@forelse($case->monitoring as $em)
{{ config('probation_workflow.em_stages')[$em->stage] ?? 'Monitoring' }} · device {{ $em->device_no ?? '—' }} · {{ $em->provider ?? '' }} {{ ucfirst($em->status) }}
{{ optional($em->start_date)->format('d M Y') }} – {{ optional($em->end_date)->format('d M Y') ?? 'open' }}@if($em->conditions) · {{ $em->conditions }}@endif
@if($em->last_latitude)
Last position: {{ $em->last_latitude }}, {{ $em->last_longitude }} ({{ optional($em->last_seen_at)->format('d M Y H:i') }})
@endif
@csrf @method('PUT')
@empty

No electronic monitoring recorded.

@endforelse
@csrf
Live tracking needs a device provider integration; positions can be recorded here meanwhile.
SMS reminders
@if(!\App\Support\SmsSender::configured())
No SMS gateway configured yet — messages are kept in the outbox. See “SMS reminders” in the menu.
@endif
@csrf
@foreach($case->smsMessages->take(8) as $m)
{{ $m->status }} {{ $m->created_at->format('d M H:i') }} · {{ \Illuminate\Support\Str::limit($m->message, 90) }}
@endforeach