{{-- Inline PDF header for bulk export and multi-language documents. Used when the Snappy header-html is blank (multi-language) or for bulk print (isInBulk). Callers may pass $headerData directly; otherwise defaults are built from the invoice/estimate already available in the parent view. Required: headerView — e.g. sales::invoices.template1.layout.header Optional: documentType — 'estimate' (also inferred from headerView path containing "estimates.") --}} @php $isEstimate = ($documentType ?? null) === 'estimate' || str_contains($headerView ?? '', 'estimates.'); $resolvedHeaderData = $headerData ?? ( $isEstimate ? [ 'formDesign' => $formDesign, 'settings' => $settings, 'reference' => ($estimate ?? null)?->code, 'title' => $title ?? ( ($estimate ?? null)?->type ? 'sales::estimates.' . ($estimate ?? null)?->type : 'sales::estimates.estimate' ), 'headerContent' => $formDesign->header, 'companyInfo' => $companyInfo ?? null, ] : [ 'formDesign' => $formDesign, 'settings' => $settings, 'reference' => ($invoice ?? null)?->reference ?? ($invoiceMetadata['reference'] ?? null), 'title' => ($invoice ?? null)?->pdfTitle, 'headerContent' => $formDesign->header, 'companyInfo' => $companyInfo ?? null, ] ); @endphp @include($headerView, $resolvedHeaderData)