@extends('layouts.app') @section('title', 'BusGo | Trip Management') @section('content')

Trips

Manage and track all bus trips.

New Trip
@php $totalTrips = $trips->count(); $scheduledCount = $trips->where('status', 'Scheduled')->count(); $ongoingCount = $trips->where('status', 'Ongoing')->count(); $completedCount = $trips->where('status', 'Completed')->count(); $cancelledCount = $trips->where('status', 'Cancelled')->count(); @endphp

Total Trips

{{ $totalTrips }}

Scheduled

{{ $scheduledCount }}

Ongoing

{{ $ongoingCount }}

Completed

{{ $completedCount }}

Cancelled

{{ $cancelledCount }}

Trip Schedule

Reset
@forelse($trips as $trip) @empty @endforelse
Trip ID Route Bus Driver Departure Fare Status Actions
#{{ str_pad($trip->id, 6, '0', STR_PAD_LEFT) }}
{{ $trip->from_station ?? 'N/A' }} → {{ $trip->to_station ?? 'N/A' }}
{{ $trip->duration ?? '—' }} hours
{{ $trip->bus->name ?? 'N/A' }}
{{ $trip->bus->number_plate ?? 'N/A' }}
{{ $trip->driver->name ?? 'N/A' }}
{{ \Carbon\Carbon::parse($trip->start_date)->format('d M Y') }}
{{ $trip->start_time }}
ZMW {{ number_format($trip->bus_fare, 2) }} {{ ucfirst($trip->status) }} @if($trip->isScheduled())
@csrf
@endif @if($trip->isOngoing())
@csrf
@endif @if($trip->canBeCancelled()) @endif

No trips found

Click "New Trip" to schedule your first trip.

@endsection