{{-- Training Session — read-only detail for a care worker. From EmployeeSessionController@show: $session (trainer, attendees_count), $myStatus Care workers do not self-register; a manager books them onto sessions. --}} @extends('layouts.app') @section('title', 'Session Details') @section('content') @include('employee._flash') @php $isPast = $session->hasEnded(); $isBooked = $myStatus && $myStatus !== 'cancelled'; $isOnline = $session->format === 'online'; $start = \Carbon\Carbon::parse($session->start_time); $end = $start->copy()->addMinutes((int) $session->duration_minutes); // My status → a single badge. if ($myStatus === 'attended') { $badge = ['class' => 'bg-secondary-container text-on-secondary-container', 'icon' => 'check_circle', 'label' => 'You attended']; } elseif ($myStatus === 'no_show') { $badge = ['class' => 'bg-error-container text-error', 'icon' => 'cancel', 'label' => 'Marked as missed']; } elseif ($isBooked && $isPast) { $badge = ['class' => 'bg-surface-container-high text-on-surface-variant', 'icon' => 'event_busy', 'label' => 'Session ended']; } elseif ($isBooked) { $badge = ['class' => 'bg-primary/10 text-primary', 'icon' => 'event_available', 'label' => 'You are booked']; } elseif ($isPast) { $badge = ['class' => 'bg-surface-container-high text-on-surface-variant', 'icon' => 'event_busy', 'label' => 'Session ended']; } else { $badge = ['class' => 'bg-surface-container-high text-on-surface-variant', 'icon' => 'info', 'label' => 'Not booked']; } @endphp arrow_back Back to sessions
{{-- Header --}}
{{ $isOnline ? 'Online' : 'In-Person' }} {{ $badge['icon'] }}{{ $badge['label'] }}

{{ $session->title }}

@if($session->training_code)

Ref: {{ $session->training_code }}

@endif
{{-- Date chip --}}

{{ $session->session_date->format('M') }}

{{ $session->session_date->format('j') }}

{{ $session->session_date->format('D') }}

{{-- Certificate of attendance (once marked attended) --}} @if($myStatus === 'attended')

workspace_premium You attended this session — your certificate of attendance is ready.

download Download certificate
@endif {{-- Feedback (once attended) — read by Admin / Head of Operations only --}} @if($myFeedback === false)

rate_review How was this training? Your feedback takes a few minutes and isn’t shared with the trainer.

edit_note Give feedback
@elseif($myFeedback)

task_alt You gave feedback on this session on {{ $myFeedback->created_at->format('j M Y') }} — thank you.

@endif {{-- Upload the provider's certificate (e.g. Team Teach) once the course has run --}} @if($canUploadCert)
@if($myBooking->certificate_path)

task_alt Certificate uploaded {{ $myBooking->certificate_uploaded_at?->format('j M Y') }} — {{ $myBooking->certificate_name ?: 'view' }}

@else

upload_file Upload the certificate you received for this course, so it's on your training record.

@endif
@csrf

PDF or photo, max 30 MB.

@error('certificate')

{{ $message }}

@enderror
@endif {{-- Details --}}
calendar_today
Date
{{ $session->session_date->format('l, j F Y') }}
schedule
Time
{{ $start->format('H:i') }} – {{ $end->format('H:i') }} · {{ $session->duration_minutes }} min
{{ $isOnline ? 'videocam' : 'location_on' }}
{{ $isOnline ? 'Location' : 'Venue' }}
{{ $isOnline ? $session->meetingProvider().' (online)' : ($session->location ?? 'Venue to be confirmed') }}
person
Trainer{{ $session->supportTrainers()->isNotEmpty() ? 's' : '' }}
{{ $session->trainerName() ?? 'To be confirmed' }}
@foreach($session->supportTrainers() as $st)
{{ $st->name }} · support
@endforeach
@if($session->capacity !== null)
group
Places
{{ $session->attendees_count }} / {{ $session->capacity }} booked
@endif
{{-- Joining link — only when booked, upcoming and online --}} @if($isOnline && $isBooked && ! $isPast && $session->teams_link)
videocam Join on {{ $session->meetingProvider() }}

The join link becomes available because you’re booked onto this session.

@endif {{-- Description / notes --}} @if($session->notes)

description About this session

{{ $session->notes }}

@endif {{-- Resources / handouts — for booked staff, trainers and managers --}} @if($session->resources->isNotEmpty() && \App\Http\Controllers\SessionResourceController::canView(auth()->user(), $session))

folder_open Resources

Handouts for this session — download them before you attend.

@endif {{-- Venue / parking info and course guide (also in the booking email) --}} @if($session->attendee_info)

local_parking Venue information

{{ $session->attendee_info }}

@endif @if($guide = \App\Support\SessionAttendeeGuide::for($session))

checklist {{ $guide['heading'] }}

    @foreach($guide['items'] as $item)
  • {{ $item }}
  • @endforeach
@endif {{-- Booking --}} @php $canSelfBook = in_array(auth()->user()->primaryRole(), \App\Http\Controllers\EmployeeSessionController::SELF_BOOK_ROLES, true); @endphp @if(! $isPast)
@if($canSelfBook) @if($isBooked)
check_circle You’re booked onto this session.
@csrf
@else
@csrf

Add yourself to this training session.

@endif @elseif(! $isBooked)
info

Want a place on this session?

Places are arranged by your manager. Speak to your Service Manager or Registered Manager to be booked onto this training.

@endif {{-- Managers (SM / RM / OM) can also book their team straight from here. --}} @php $canBookTeam = auth()->user()->can('sessions.assign') && \Illuminate\Support\Facades\Route::has(auth()->user()->primaryRole().'.team.session.manage'); @endphp @if($canBookTeam)
group_add Book my team onto this session

Pick which of your staff to book — and manage who’s already on it.

@endif
@endif
{{-- Who's booked on this session + who booked them (managers / trainers / admins) --}} @if($canSeeRoster)

Booked staff

@php $bookedCount = $roster->whereNotIn('status', ['on_leave'])->count(); @endphp {{ $bookedCount }}{{ $session->capacity ? ' / '.$session->capacity : '' }} booked
@if($roster->isEmpty())

No one is booked on this session yet.

@else
@foreach($roster as $r) @php $badge = match($r['status']) { 'attended' => ['Attended', 'bg-primary/10 text-primary'], 'no_show' => ['No-show', 'bg-error-container text-error'], 'on_leave' => ['On leave', 'bg-gold/20 text-on-surface'], default => ['Booked', 'bg-surface-container-high text-on-surface-variant'], }; @endphp @endforeach
Staff member Status Booked by Booked on
{{ $r['name'] }} {{ $r['email'] }} {{ $badge[0] }} @if($r['certificate_url'] ?? null) workspace_premiumCertificate @endif {{ $r['booked_by'] }} {{ $r['booked_at'] ? \Illuminate\Support\Carbon::parse($r['booked_at'])->format('j M Y, H:i') : '—' }}
@endif
@endif @endsection