@extends('layouts.app') @php($canManage = auth()->user()->isAdminOrStaff()) @php($canWrite = $canManage || auth()->user()->isTrainer()) @section('title', 'Lesson Details') @section('subtitle', $booking->starts_at->format('D, j M Y · g:i A')) @section('content') Schedule @if ($canManage) New lesson @endif

Lesson overview

{{ $statuses[$booking->status] ?? ucfirst($booking->status) }}
Student
{{ $booking->student?->user?->name ?? '—' }}
{{ $booking->student?->student_number }}
Trainer
{{ $booking->trainer?->user?->name ?? '—' }}
{{ $booking->trainer?->specialization ?? $booking->trainer?->designation }}
Date & time
{{ $booking->starts_at->format('l, j M Y') }}
{{ $booking->starts_at->format('g:i A') }} – {{ $booking->ends_at->format('g:i A') }} ({{ $booking->starts_at->diffInMinutes($booking->ends_at) }} min)
Vehicle
@if ($booking->vehicle) {{ $booking->vehicle->make }} {{ $booking->vehicle->model }}
{{ $booking->vehicle->registration_number }}
@else
No vehicle assigned
@endif
Course
{{ $booking->course?->name ?? $booking->student?->course?->name ?? '—' }}
Meeting point
{{ $booking->location ?: 'Main office' }}
@if ($booking->notes)
Notes
{{ $booking->notes }}
@endif
Scheduled {{ $booking->created_at->diffForHumans() }}@if ($booking->creator) by {{ $booking->creator->name }}@endif.
@if ($booking->attendance)

Attendance

{{ ucfirst($booking->attendance->status) }} Recorded for {{ $booking->attendance->date?->format('j M Y') }} @if ($booking->attendance->remarks) · {{ $booking->attendance->remarks }} @endif
@endif

Lesson report

Shared with the student's progress record

@if ($booking->report)
{{ $booking->report->rating }}/5 @for ($i = 1; $i <= 5; $i++) @endfor
@foreach (['topics_covered' => 'Topics covered', 'performance_notes' => 'Performance notes', 'next_steps' => 'Next steps'] as $field => $label) @if ($booking->report->{$field})
{{ $label }}
{{ $booking->report->{$field} }}
@endif @endforeach
@elseif ($canReport)
@csrf
@else
@endif
@if ($canWrite)

Update status

@csrf
Marking the lesson completed records attendance automatically.
@endif @if ($canManage)
@csrf @method('DELETE')
@endif
@endsection