{{-- resources/views/probation/cases/_interventions.blade.php Interventions = Tool C treatment-plan areas (added automatically) + any other intervention the officer records. Plan-sourced entries are edited in Tool C; here their type and progress are updated. --}} @php $types = config('probation_supervision.intervention_types'); $statuses = config('probation_supervision.intervention_statuses'); $fromPlan = $case->interventions->filter(fn ($i) => $i->treatment_plan_item_id)->sortBy('id'); $own = $case->interventions->reject(fn ($i) => $i->treatment_plan_item_id)->sortByDesc('id'); $badge = ['planned' => 'bg-secondary', 'ongoing' => 'bg-primary', 'completed' => 'bg-success']; $count = $case->interventions->groupBy('status')->map->count(); @endphp
Interventions
@foreach($statuses as $k => $l){{ $l }}: {{ $count[$k] ?? 0 }}@endforeach
{{-- ---------- from the treatment plan ---------- --}}
From the treatment plan (Tool C)
@if($fromPlan->isEmpty())

Nothing yet — areas saved in Supervision → Treatment Plan (Tool C) appear here automatically.

@else
@foreach($fromPlan as $iv) @endforeach
AreaNeedsAction planTime frameResponsibleType · Progress
{{ $iv->area_title }} {{ $iv->description }} {{ $iv->interventions_used }} {{ $iv->time_frame }} {{ $iv->provider }}
@csrf @method('PUT')
@endif {{-- ---------- other interventions ---------- --}}
Other interventions
@forelse($own as $iv)
{{ $types[$iv->plan_type] ?? ucwords($iv->plan_type) }}@if($iv->area_title) — {{ $iv->area_title }}@endif {{ $statuses[$iv->status] ?? $iv->status }} @if($iv->description)
{{ $iv->description }}
@endif
@if($iv->interventions_used)Action: {{ $iv->interventions_used }} · @endif @if($iv->time_frame)Time frame: {{ $iv->time_frame }} · @endif {{ $iv->provider }}
@csrf @method('DELETE')
@csrf @method('PUT')
@empty

No other interventions.

@endforelse
@csrf
Add another intervention