@foreach ($items as $item)
@php $imagePath = public_path($item->image); $hasImage = $item->image && File::exists($imagePath); @endphp @if ($hasImage) {{ $item->name }} @else @endif

{{ $item->name }}

@endforeach