@isset($basicData['foto'])
@php
$photos = $formFoto['upload_foto'] ?? [];
if (!is_array($photos)) {
$photos = [];
}
$groupedPhotos = collect($photos)->groupBy('category');
$mainPhotos = $groupedPhotos->filter(fn($_, $key) => $key !== 'Lainnya');
$otherPhotos = $groupedPhotos->get('Lainnya', collect());
@endphp
@if ($groupedPhotos->isEmpty())
Tidak ada foto yang tersedia.
@else
@foreach ($mainPhotos as $category => $photos)
{{ $category }}
@php
$groupedBySubcategory = $photos->groupBy('sub');
@endphp
@if ($groupedBySubcategory->isEmpty())
Tidak ada subkategori yang tersedia.
@else
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
{{ $subcategory ?: '' }}
@foreach ($subPhotos as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
{{ $item['name'] }}
@if ($statusLpj || file_exists($imagePath))
![{{ $item['path'] }}]({{ $imagePath }})
@else
Foto tidak ditemukan.
@endif
@if (($index + 1) % 2 == 0 && !$loop->last)
@endif
@endforeach
@endforeach
@endif
@endforeach
@if (!$otherPhotos->isEmpty())
Lainnya
@php
$groupedBySubcategory = $otherPhotos->groupBy('sub');
@endphp
@if ($groupedBySubcategory->isEmpty())
Tidak ada subkategori yang tersedia.
@else
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
{{ $subcategory ?: '' }}
@foreach ($subPhotos as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
{{ $item['name'] }}
@if ($statusLpj || file_exists($imagePath))
![{{ $item['path'] }}]({{ $imagePath }})
@else
Foto tidak ditemukan.
@endif
@if (($index + 1) % 2 == 0 && !$loop->last)
@endif
@endforeach
@endforeach
@endif
@endif
@endif
@endisset