@php $vehicle = $quote->vehicle; $customer = $quote->customer; $titleParts = array_filter([ // $vehicle?->make, $vehicle?->model, $vehicle?->year, $vehicle?->fuel_type, $vehicle?->engine_size ? $vehicle->engine_size . ' CC' : null, ]); $title = !empty($titleParts) ? strtoupper(implode(' ', $titleParts)) : 'QUOTE DETAILS'; $statusClasses = [ 'web_inquiries' => 'bg-label-warning text-warning', 'portal_quote' => 'bg-label-info text-info', 'update_quote' => 'bg-label-primary text-primary', 'accepted' => 'bg-label-success text-success', 'archived' => 'bg-label-secondary text-secondary', 'job_card' => 'bg-label-dark text-dark', 'sold' => 'bg-label-success text-success', ]; $statusClass = $statusClasses[$quote->status] ?? 'bg-label-secondary text-secondary'; $vrm = $vehicle?->vrm ?: $quote->vrm ?? 'N/A'; $shortVin = $vehicle?->vin ? substr($vehicle->vin, -7) : 'N/A'; $quoteUserLabel = match ($listingType) { 'accepted-quotes' => 'Accepted By', 'archived-quotes' => 'Archived By', default => 'Quoted By', }; $quoteUserName = match ($listingType) { 'accepted-quotes' => $quote->acceptedByUser?->name, 'archived-quotes' => $quote->archivedByUser?->name, default => $quote->updatedByUser?->name, }; @endphp