@if($user->photo_gallery) @foreach(json_decode($user->photo_gallery, true) as $img) @php $imgPath = is_array($img) ? ($img['path'] ?? reset($img)) : $img; $imgFilename = $imgPath ? basename($imgPath) : null; $storageKey = $imgFilename ? ('gallery/' . $imgFilename) : null; $imageUrl = ($storageKey && \Illuminate\Support\Facades\Storage::disk('public')->exists($storageKey)) ? \Illuminate\Support\Facades\Storage::disk('public')->url($storageKey) : asset('images/default-placeholder.png'); @endphp @endforeach @endif