|
@if($isTransporter)
id) }}>{{ $job->id }}
@elseif(auth()->user()->isAdmin() || auth()->user()->can('jobs.view'))
id) }}>{{ $job->id }}
@else
{{ $job->id }}
@endif
|
@if ($isTransporter)
@php
$loggedInTransporterId = auth()->id();
$tripsForUser = $job->trips->where('transport_id', $loggedInTransporterId);
$vehiclesFromTrips = $tripsForUser->map(function($trip){
try {
return $trip->vehicle;
} catch (Exception $e) {
return null;
}
})->filter();
$vehicleCount = $vehiclesFromTrips->unique('id')->count();
@endphp
{{ $vehicleCount ?? 0}}
@else
{{$job->transporters->count() ? $job->transporters->count() : 0}}
@endif
|
{{$job->loadingLocation->name ?? null }} |
{{$job->offloadingLocation->name ?? null}} |
{{ $job->load_date->format('d/m/Y') .' '. $job->load_time_format}} |
{{$job->offload_date->format('d/m/Y') .' '. $job->offload_time_format}}
|
{{-- {{ (int)$job->load_weight }} | --}}
{{ $loadProgress['formatted'] ?? '0/0' }} |
@php
$jobStatus = getJobStatusByRole($job, $user);
@endphp
{{ ucwords($jobStatus['status_label']) }}
|
@if(!$isTransporter)
@else
@endif
|
@php
$loggedInTransporterId = auth()->id();
$tripsForUser = $job->trips->where('transport_id', $loggedInTransporterId);
$vehiclesFromTrips = $tripsForUser->map(function($trip){
try {
return $trip->vehicle;
} catch (Exception $e) {
return null;
}
})->filter()->unique('id');
// dump($vehiclesFromTrips);
$vehicleCount = $vehiclesFromTrips->count();
@endphp
@if($vehicleCount > 0)
@foreach($vehiclesFromTrips as $vehicle)
-
{{ $vehicle->registration_number }} - {{ $vehicle->make }} {{ $vehicle->model }} ({{ $vehicle->transporter->name }})
@endforeach
@else
No vehicles found for this job.
@endif
@endforeach