@extends('layouts.app') @section('title', 'Training Risk') @section('content') @include('partials.flash') @php $base = $viewer->primaryRole(); @endphp
{{-- Breadcrumb trail (viewer โ†’ focus) --}}

Expired renewals and training expiring within the next {{ \App\Concerns\AssessesTrainingRisk::$riskWindowDays }} days.

{{-- Service filter (a manager may run more than one service) --}} @if($services->count() >= 1)
@if($focus->id !== $viewer->id)@endif
@endif
{{-- Summary tiles --}}
errorExpired

{{ $summary['expired'] }}

scheduleExpiring soon

{{ $summary['expiring'] }}

groupsAt risk total

{{ $summary['total'] }}

@if($mode === 'worker') {{-- One care worker's at-risk courses --}}

{{ $focus->name }}

{{ $focus->roleLabel() }}{{ $focus->location?->name ? ' ยท '.$focus->location->name : '' }}

@if($canRemind && $summary['total'] > 0)
@csrf
@endif
@forelse($items as $it) @empty @endforelse
CourseStatusDue date
{{ $it->title }} @if($it->risk === 'expired') Expired {{ abs($it->days) }}d ago @else Expires in {{ $it->days }}d @endif {{ \Carbon\Carbon::parse($it->due_at)->format('j M Y') }}
No expired or expiring training โ€” all up to date.
@else {{-- Direct reports with rolled-up risk --}}

Reminders go to the {{ $targetNoun }} below.

@forelse($rows as $row) @php $drill = route($base.'.training-risk', array_merge(['user' => $row['user']->id], $filterParam)); @endphp @empty @endforelse
{{ Str::singular($targetNoun) }} Care workers Expired Expiring Actions
{{ $row['user']->name }}

{{ $row['role'] }}

{{ $row['is_worker'] ? 'โ€”' : $row['workers'] }} @if($row['expired']) {{ $row['expired'] }} @else 0 @endif @if($row['expiring']) {{ $row['expiring'] }} @else 0 @endif
{{ $row['is_worker'] ? 'visibility' : 'arrow_forward' }}{{ $row['is_worker'] ? 'View' : 'Open' }} @if($row['at_risk'] > 0)
@csrf
@endif
No one to show here.
@endif @endsection