@extends('layouts.app') @section('title', 'Vehicle Profile') @section('subtitle', $vehicle->registration_number) @section('content') Fleet Edit vehicle

Upcoming lessons

Book
@forelse ($upcomingBookings as $lesson) @empty @endforelse
DateStudentTrainerTypeStatus
{{ $lesson->starts_at->format('j M Y') }}
{{ $lesson->starts_at->format('g:i A') }} – {{ $lesson->ends_at->format('g:i A') }}
{{ $lesson->student?->user?->name ?? '—' }} {{ $lesson->trainer?->user?->name ?? '—' }} {{ $lesson->typeLabel() }} {{ ucfirst($lesson->status) }}

Lesson history

@forelse ($recentBookings as $lesson) @empty @endforelse
DateStudentTrainerTypeStatus
{{ $lesson->starts_at->format('j M Y') }} {{ $lesson->student?->user?->name ?? '—' }} {{ $lesson->trainer?->user?->name ?? '—' }} {{ $lesson->typeLabel() }} {{ ucfirst($lesson->status) }}

Specifications

@php $specs = [ 'Registration' => $vehicle->registration_number, 'Type' => \App\Models\Vehicle::TYPES[$vehicle->type] ?? ucfirst($vehicle->type), 'Transmission' => ucfirst($vehicle->transmission), 'Fuel' => ucfirst($vehicle->fuel_type), 'Seats' => $vehicle->seats, 'Year' => $vehicle->year, 'Odometer' => number_format($vehicle->odometer_km).' km', ]; @endphp @foreach ($specs as $label => $value)
{{ $label }} {{ $value }}
@endforeach

Compliance & service

@php $dates = [ 'Insurance expiry' => [$vehicle->insurance_expiry, $vehicle->insuranceExpiringSoon()], 'Registration expiry' => [$vehicle->registration_expiry, $vehicle->registration_expiry && $vehicle->registration_expiry->isPast()], 'Last service' => [$vehicle->last_service_date, false], 'Next service' => [$vehicle->next_service_date, $vehicle->needsService()], ]; @endphp @foreach ($dates as $label => [$date, $warn])
{{ $label }} {{ $date?->format('j M Y') ?? 'Not set' }} @if ($warn)@endif
@endforeach @if ($vehicle->notes)
Notes
{{ $vehicle->notes }}
@endif
@csrf @method('DELETE')
@endsection