@foreach($gallery_images as $gallery) @php($coverImage = $gallery->images->first()) @if($coverImage)
@endif @endforeach