@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) @isset($subcategory)
{{ $subcategory ?: '' }}
@endisset
@foreach ($subPhotos as $index => $item) @php $imagePath = storage_path('app/public/' . $item['path']); @endphp

{{ $item['name'] }}

@if ($statusLpj || file_exists($imagePath)) {{ $item['path'] }} @else

Foto tidak ditemukan.

@endif @isset($item['description'])

{{ $item['description'] }}

@endisset
@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) @isset($subcategory)
{{ $subcategory ?: '' }}
@endisset
@foreach ($subPhotos as $index => $item) @php $imagePath = storage_path('app/public/' . $item['path']); @endphp
{{ $item['name'] }}
@if ($statusLpj || file_exists($imagePath)) {{ $item['path'] }} @else

Foto tidak ditemukan.

@endif
@if (($index + 1) % 2 == 0 && !$loop->last)
@endif @endforeach
@endforeach @endif
@endif @endif @endisset