@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
| 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) }} |
|
{{ $vehicle->registration_no }}{{ $vehicle->type }} · {{ $vehicle->year }} · {{ $vehicle->capacity }} seats · Driver: {{ $vehicle->driverName() }}
{{ $vehicle->routes->count() > 0 ? 'Assigned' : 'Unassigned' }}
@foreach ($vehicle->routes as $route)
{{ $route->name }}
@endforeach
@foreach ([
['label' => 'Total Fuel', 'value' => $litres1($totalL).' L'],
['label' => 'Total Cost', 'value' => $money($totalCost)],
['label' => 'Entries', 'value' => $fuel->count()],
] as $mini)
{{ $mini['value'] }}
{{ $mini['label'] }}
Fuel History
@forelse ($fuel->sortByDesc('id') as $i => $entry)
@if ($i > 0)@endif
{{ \App\Support\Fmt::day($entry->isoDate()) }}
{{ $entry->station ?: '—' }} ·
{{ \App\Support\Fmt::litres($entry->litres) }} L @ {{ $money($entry->price_per_litre) }}
{{ $money($entry->amount) }}
No fuel entries recorded for this vehicle. @endforelse |
|||||||
Add Fuel Entry{{ $vehicle->registration_no }} @include('transport.partials.fuel-form') |
|||||||
| @include('transport.partials.vehicle-form', [ 'action' => route('transport.vehicles.update', $vehicle), 'method' => 'PUT', 'prefix' => 'vehicle-'.$vehicle->id, 'row' => $vehicle, 'staff' => $staff, ]) | |||||||
| No vehicles match your filters. | |||||||
Fields marked * are required.
@include('transport.partials.vehicle-form', [ 'action' => route('transport.vehicles.store'), 'method' => 'POST', 'prefix' => 'vehicle-new', 'row' => null, 'staff' => $staff, ])