@php $pciIiiBAttMap = $existingAttachmentsMap ?? []; $pciIiiBDocRows = []; $pciIiiBDocAnnRows = []; $pciIiiBPhotoRows = []; $pciIiiBPhotoAnnRows = []; $pciIiiBMapPull = function (string $mapKey) use ($pciIiiBAttMap): array { $out = []; if (empty($pciIiiBAttMap[$mapKey]) || ! is_array($pciIiiBAttMap[$mapKey])) { return $out; } foreach ($pciIiiBAttMap[$mapKey] as $f) { if (empty($f['path'])) { continue; } $out[] = ['path' => $f['path'], 'title' => $f['name'] ?? basename((string) $f['path'])]; } return $out; }; $pciIiiBDocRows = $pciIiiBMapPull('pc_iii_b_supporting_documents_attachments[]'); $pciIiiBDocAnnRows = $pciIiiBMapPull('pc_iii_b_supporting_documents_annexures[]'); $pciIiiBPhotoRows = $pciIiiBMapPull('pc_iii_b_site_photos_attachments[]'); $pciIiiBPhotoAnnRows = $pciIiiBMapPull('pc_iii_b_site_photos_annexures[]'); @endphp {{-- Attachments --}}

Note: Copy of T.S. and M.Bs must be attached.

@include('pc-forms.partials.pci-textarea-map-files', [ 'filesEdit' => $pciIiiBEdit, 'attachmentRows' => $pciIiiBDocRows, 'annexureRows' => $pciIiiBDocAnnRows, 'attFieldName' => 'pc_iii_b_supporting_documents_attachments[]', 'annFieldName' => 'pc_iii_b_supporting_documents_annexures[]', 'uid' => 'pci-pc-iii-b-docs', 'pcForm' => $pcForm ?? null, ])

Photographs showing physical progress at site.

@include('pc-forms.partials.pci-textarea-map-files', [ 'filesEdit' => $pciIiiBEdit, 'attachmentRows' => $pciIiiBPhotoRows, 'annexureRows' => $pciIiiBPhotoAnnRows, 'attFieldName' => 'pc_iii_b_site_photos_attachments[]', 'annFieldName' => 'pc_iii_b_site_photos_annexures[]', 'uid' => 'pci-pc-iii-b-photos', 'pcForm' => $pcForm ?? null, ])