@forelse($job->documents ?? [] as $document) @empty @endforelse
Documents Trip ID Uploaded By Quantity (Metric Tons) Date & Time Action
{{ $document->mandatoryDocument->name ?? null }} {{ $document->trip->id ?? null }} {{ $document->uploadedBy->name ?? null }} @php $quantity = null; if (!empty($document)) { $isWaybridge = (int) $document->mandatory_doc_id === 33; $quantity = $isWaybridge ? optional($document->trip)->load_metric_tons : optional($document->trip)->offload_metric_tons; } @endphp {{ (int) $quantity ?? 0 }} {{ $document->created_at ? $document->created_at->format('d/m/Y, h:i A') : null }} @php if($isTransporter) { $url = route('transporter.jobs.documents.show', ['job' => $job->id, 'document' => $document->id]); } else { $url = route('admin.jobs.documents.show', ['job' => $job->id, 'document' => $document->id]); } $canDelete = !$isTransporter || ($isTransporter && optional($document->uploadedBy)->id == auth()->id()); @endphp @if(!$isTransporter || ($isTransporter && optional($document->uploadedBy)->id == auth()->id())) @else @endif