@isset($basicData['foto']) @php $photos = $formFoto['upload_foto'] ?? []; if (!is_array($photos)) { $photos = []; } $groupedPhotos = collect($photos)->groupBy('category'); $mainPhotos = $groupedPhotos->filter(fn($_, $key) => strtolower($key) !== 'lainnya'); // Definisikan urutan yang diinginkan $desiredOrder = [ 'PETA LOKASI', 'GAMBAR SITUASI / SURAT UKUR', 'BLAD TATA KOTA', 'FOTO JAMINAN', 'DOKUMEN PENDUKUNG' ]; // Urutkan ulang $mainPhotos sesuai urutan yang diinginkan $orderedMainPhotos = collect(); foreach ($desiredOrder as $category) { if ($mainPhotos->has($category)) { $orderedMainPhotos->put($category, $mainPhotos->get($category)); } } // Tambahkan kategori lain yang tidak ada dalam urutan yang diinginkan foreach ($mainPhotos as $category => $photos) { if (!in_array($category, $desiredOrder)) { $orderedMainPhotos->put($category, $photos); } } $mainPhotos = $orderedMainPhotos; $otherPhotos = $groupedPhotos->get('lainnya', collect()); @endphp @if ($groupedPhotos->isEmpty())
Tidak ada foto yang tersedia.
@else @foreach ($mainPhotos as $category => $photos) @if($category=='DOKUMEN PENDUKUNG') @php continue; @endphp @endif @php $groupedBySubcategory = $photos->groupBy('sub'); @endphp @foreach ($groupedBySubcategory as $subcategory => $subPhotos) @if (count($subPhotos) > 0) @foreach ($subPhotos->chunk(2) as $chunkedPhotos)|
{{ $category }} - @isset($subcategory) @if (trim($subcategory) !== '') {{ $subcategory }} - @endif @endisset {{ $item['name'] ?? '' }} |
|
{{ $category }} - @isset($subcategory) @if (trim($subcategory) !== '') {{ $subcategory }} - @endif @endisset {{ $item['name'] ?? '' }} @if ($statusLpj || file_exists(public_path('storage/' . $item['path']))) @if ($isImage){{ $item['description'] }} @endisset |
|
{{ $category }} - @isset($subcategory) @if (trim($subcategory) !== '') {{ $subcategory }} - @endif @endisset {{ $item['name'] ?? '' }} |
|
Lainnya - @isset($subcategory) @if (trim($subcategory) !== '') {{ $subcategory }} - @endif @endisset {{ $item['name'] ?? '' }} @if ($statusLpj || file_exists(public_path('storage/' . $item['path']))) @if ($isImage){{ $item['description'] }} @endisset |