@foreach ($sectionConfig as $photoKey => $photoName)
@if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey]))
@php
$imagePath = storage_path('app/public/' . $formFoto[$photoKey]);
$hasPhotos = true;
@endphp
{{ $photoName }}
@if ($statusLpj || file_exists($imagePath))

@endif
@endif
@endforeach
@else
@php
$sectionData = $formFoto[$sectionKey] ?? null;
@endphp
@if (!empty($sectionData))
@if ($sectionConfig['nested'])
@if (isset($sectionData[$sectionConfig['key']][0]))
@foreach ($sectionData as $index => $item)
@php
$name = $item[$sectionConfig['key']] ?? '';
$photoPath =
$sectionKey === 'object_jaminan'
? $item['foto_objek'] ?? ''
: $item['foto_rute_lainnya'] ?? '';
$imagePath = storage_path('app/public/' . $photoPath);
@endphp
@if (!empty($name) || !empty($photoPath))
@php $hasPhotos = true; @endphp
@if (!empty($name))
{{ $name }}
@endif
@if ($statusLpj || (file_exists($imagePath) && !empty($photoPath)))

@endif
@endif
@endforeach
@endif
@endif
@endif
@endforeach
@if (!$hasPhotos)
Tidak ada foto yang tersedia
@endif