@extends('layouts.app') @section('title', 'Vehicles') @section('content') @php $money = fn ($v) => \App\Support\Fmt::money2($v); $litres1 = fn ($v) => number_format((float) $v, 1); @endphp

Fleet vehicles, drivers and fuel tracking

Vehicles

CSV
@include('partials.flashes')
@foreach ([ ['label' => 'Total Vehicles', 'value' => $stats['Total Vehicles']], ['label' => 'Assigned to Routes', 'value' => $stats['Assigned to Routes']], ['label' => 'Total Seats', 'value' => $stats['Total Seats']], ['label' => 'Fuel Entries', 'value' => $stats['Fuel Entries']], ] as $stat)
{{ $stat['value'] }} {{ $stat['label'] }}
@endforeach
Clear
@forelse ($rows as $vehicle) @php $fuel = $vehicle->fuelEntries; $totalL = $fuel->sum('litres'); $totalCost = $fuel->sum('amount'); @endphp @empty @endforelse
Registration Type Year Capacity Driver Assigned Routes Total Fuel (L) Actions
{{ $vehicle->registration_no }} {{ $vehicle->id }}
{{ $vehicle->type }} {{ $vehicle->year }} {{ $vehicle->capacity }} {{ $vehicle->driverName() }} {{ $vehicle->routes->count() > 0 ? $vehicle->routes->pluck('name')->implode(', ') : '—' }} {{ $litres1($totalL) }}
@csrf @method('DELETE')
No vehicles match your filters.
{{ $rows->count() }} of {{ $all->count() }} vehicles
@if ($rows->onFirstPage()) Previous @else Previous @endif Page {{ $rows->currentPage() }} of {{ max(1, $rows->lastPage()) }} @if ($rows->hasMorePages()) Next @else Next @endif
any()) open @endif> Add Vehicle

Fields marked * are required.

@include('transport.partials.vehicle-form', [ 'action' => route('transport.vehicles.store'), 'method' => 'POST', 'prefix' => 'vehicle-new', 'row' => null, 'staff' => $staff, ])
@endsection