@extends('template.layouts.template-base') @section('title', 'View Third Party Vehicle') @section('content') @php $thirdPartyVehicles = isset($thirdPartyVehicles) && $thirdPartyVehicles->count() ? $thirdPartyVehicles : collect([$vehicle]); $activeVehiclesCount = $thirdPartyVehicles->where('status', 1)->count(); $maintenanceVehiclesCount = $thirdPartyVehicles->where('status', 2)->count(); @endphp

Basic Information

Vehicle List

@foreach ($thirdPartyVehicles as $index => $tpVehicle) @php $additionalDriverNames = $tpVehicle->secondaryDrivers()->pluck('name')->implode(', '); @endphp @endforeach
# Vehicle No Type Capacity Reg Number Model & Brand Primary Driver Additional Driver(s) Maintenance Due Status Vehicle Image
{{ $index + 1 }} {{ $tpVehicle->vehicle_number ?: '-' }} {{ optional($tpVehicle->vehicleType)->name ?: '-' }} {{ $tpVehicle->capacity_kg !== null ? rtrim(rtrim((string) $tpVehicle->capacity_kg, '0'), '.') . ' Kg' : '-' }} {{ $tpVehicle->registration_number ?: '-' }} {{ $tpVehicle->model_brand ?: '-' }} {{ optional($tpVehicle->primaryDriver)->name ?: '-' }} {{ $additionalDriverNames ?: '-' }} {{ $tpVehicle->maintenance_due_date ? $tpVehicle->maintenance_due_date->format('d M Y') : '-' }} {{ (int) $tpVehicle->status === 1 ? 'Active' : ((int) $tpVehicle->status === 2 ? 'Under Maintenance' : 'Inactive') }} @if (!empty($tpVehicle->vehicle_image)) View @else - @endif
@if ($thirdPartyVehicles->isEmpty())
No vehicles found for this transporter.
@endif
Back Edit
@include('template.layouts.error-modal') @endsection