{{-- Manage Course — the training required at each care home the SM / RM oversees. From ServiceTrainingController@index: $services (with counts + names), $totals, $q. DataTable with search, quick filters and summary tiles that filter on click. --}} @extends('layouts.app') @section('title', 'Manage Course') @section('content') @include('partials.flash') @php $role = auth()->user()->primaryRole(); $noF2f = $services->where('required_training_names_count', 0)->count(); $withOptOut = $services->where('excluded_courses_count', '>', 0)->count(); $noSpecific = $services->where('required_courses_count', 0)->count(); @endphp

Set the training required at each of your care homes: add service-specific e-learning, opt a home out of a mandatory course it doesn’t need, and choose its face-to-face trainings. Changes apply to everyone based at that home.

@if($canManageHomes)
add_home Add care home
@endif {{-- Summary tiles (click to filter) --}}
@foreach([ ['home_health', 'text-primary', 'Care homes', $services->count(), null], ['groups_2', 'text-error', 'No face-to-face set', $noF2f, 'nof2f'], ['block', 'text-[#8a6d3b]', 'Homes with mandatory opt-outs', $withOptOut, 'optout'], ['add_task', 'text-secondary', 'No service-specific courses', $noSpecific, 'nospecific'], ] as [$icon, $cls, $label, $val, $chip]) @endforeach
@if($services->isEmpty())
home_health

No care homes

You don’t oversee any care homes yet.

@else {{-- Filter toolbar --}}
search
Quick filters:
@foreach($services as $service) @php $spec = $service->requiredCourses->pluck('title')->sort()->values(); $f2f = $service->requiredTrainingNames->pluck('name')->sort()->values(); $out = $service->excludedCourses->pluck('title')->sort()->values(); $mandRequired = $totals['mandatory'] - $service->excluded_courses_count; $url = route($role.'.service-training.edit', $service); @endphp @endforeach
Care home Staff Service-specific e-learning Mandatory e-learning Face-to-face trainings Action
{{ $service->name }} {{ $service->code }} person SM: {{ $service->serviceManager?->name ?? 'Not assigned' }} {{ $service->active_care_workers_count }} {{ $spec->count() }} of {{ $totals['specific'] }} @if($spec->isNotEmpty()) {{ \Illuminate\Support\Str::limit($spec->implode(', '), 70) }} @else None added @endif {{ $mandRequired }} of {{ $totals['mandatory'] }} required @if($out->isNotEmpty()) block Opted out: {{ \Illuminate\Support\Str::limit($out->implode(', '), 60) }} @else All required @endif @if($f2f->isNotEmpty()) {{ $f2f->count() }} required
@foreach($f2f->take(4) as $t) {{ $t }} @endforeach @if($f2f->count() > 4)+{{ $f2f->count() - 4 }} more@endif
@else warning Not set yet @endif
tune Manage training @if($canManageHomes && (int) $service->registered_manager_id === (int) auth()->id()) @php $staffHere = $staffCounts[$service->id] ?? 0; @endphp @if($staffHere) lock Has {{ $staffHere }} staff — can’t delete @else
@csrf @method('DELETE')
@endif @endif

Homes with face-to-face “Not set yet” have no classroom trainings counted in their compliance — open Manage training to choose them.

@include('management._datatables') @endif @endsection