How can I do condition if the product has multiple images from the image table that shows it, and if it does not exist, it appears empty
@foreach($products as $product)
<tr>
<td>{{ $product->id }}</td>
<td>{{ $product->name }}</td>
<td class="text-center">
<span class="badge rounded-pill text-bg-primary">
{{ AppModelsProjectEcommerceProductImage::where('product_id', $product->id)->count() }}
</span>
</td>
<td>
// mutli image Product //
@if (!empty($product->images))
<img src="{{ asset('Image/ProductImage/'. $product->images->pull('0')->image) }}" alt="{{ $product->title_image }}" class="object-fit-contain" width="50" height="50">
@endif
// end mutli image Product //
</td>
</tr>
@endforeach
Attempt to read property “image” on null