@extends('layouts.app') @section('title', 'My Transport') @section('page-title', 'Transport') @section('content')

My Transport

@if($assignment) @php $route = $assignment->route; $vehicle = $route->vehicle; @endphp {{-- Route Card --}}

{{ $route->name }}

Route {{ $route->code }} · {{ $route->formatted_fee }}/month

{{-- Vehicle + Driver --}} @if($vehicle)

Vehicle

{{ $vehicle->vehicle_number }}

{{ ucfirst($vehicle->type) }} · {{ $vehicle->capacity }} seats

Driver

{{ $vehicle->driver_name ?? 'Not assigned' }}

@if($vehicle->driver_phone)

{{ $vehicle->driver_phone }}

@endif
@endif {{-- My Stop --}}

My Stop

{{ $assignment->stop->name }}

@if($assignment->stop->pickup_time) Pickup: {{ $assignment->stop->formatted_pickup }} @endif @if($assignment->stop->drop_time) Drop: {{ $assignment->stop->formatted_drop }} @endif
@if($assignment->stop->landmark)

{{ $assignment->stop->landmark }}

@endif
{{-- Full Route Timeline --}}

Route Timeline

@foreach($route->stops as $i => $stop) @php $isMyStop = $stop->id === $assignment->stop_id; @endphp
@if(!$loop->last)
@endif

{{ $stop->name }} @if($isMyStop)YOU@endif

@if($stop->pickup_time){{ \Carbon\Carbon::parse($stop->pickup_time)->format('h:i A') }}@endif @if($stop->pickup_time && $stop->drop_time) / @endif @if($stop->drop_time){{ \Carbon\Carbon::parse($stop->drop_time)->format('h:i A') }}@endif

@endforeach
@else

No transport assigned

Contact the school office if you use school transport

@endif
@endsection