@extends('layouts.dashboard') @section('title', 'Loads') @section('content')

Loads

Manage and track your active and historical loads.

Add Load
Open Loads ({{ $openCount }}) Delivered Loads ({{ $deliveredCount }}) Completed Loads ({{ $completedCount }}) Invoiced / Paid ({{ $invoicedCount }})
@foreach($loads as $load) @php $shipper = $load->shippers->first(); $consignee = $load->consignees->first(); $assignment = $load->assignments->first(); $origin = collect([$shipper?->city, $shipper?->stateProvince?->code])->filter()->implode(', ') ?: '—'; $destination = collect([$consignee?->city, $consignee?->stateProvince?->code])->filter()->implode(', ') ?: '—'; $assigneeLabel = 'Assign Later'; $driverId = null; $carrierId = null; if ($assignment?->assignment_type === 'driver') { $driverId = $assignment->driver?->id; $assigneeLabel = $assignment->driver?->full_name ?? 'Assign Later'; if ($assignment->truck?->truck_number) { $assigneeLabel .= ' / '.$assignment->truck->truck_number; } } elseif ($assignment) { $carrierId = $assignment->carrierCompany?->id; $assigneeLabel = $assignment->carrierCompany?->display_name ?? 'Assign Later'; } $customerId = $load->customerCompany?->id; $customerName = $load->customerCompany?->display_name ?? '—'; $statusName = $load->status?->name ?? 'Open'; $statusKey = \Illuminate\Support\Str::slug($statusName); @endphp @endforeach
Load # W/O # Customer Driver / Carrier Pickup Date Delivery Date Origin Destination Status Actions
{{ $load->load_number }} {{ $load->wo_reference ?: '—' }} @if($customerId) {{ $customerName }} @else {{ $customerName }} @endif @if($driverId) {{ $assigneeLabel }} @elseif($carrierId) {{ $assigneeLabel }} @else {{ $assigneeLabel }} @endif {{ $shipper?->displayScheduledAt() ?? '—' }} {{ $consignee?->displayScheduledAt() ?? '—' }} {{ $origin }} {{ $destination }} {{ $statusName }}
@include('ui.modals') @push('styles') @endpush @push('scripts') @endpush @endsection