Reputation: 27
In my code I have a nested foreach
, but when run it shows this error
Here is my code:
@foreach ($product as $user)
<p>This is title {{ $user->title }}</p>
<p>This is category {{ $user->category }}</p>
<p>This is sub category {{ $user->sub_category }}</p>
@foreach ($product_image as $product_image)
<p>This is image {{ $product_image->p_image }}</p>
@endforeach
@endforeach
Upvotes: 1
Views: 767
Reputation: 142
The second foreach sould be:
@foreach ($User->product_images as $product_image)
an not:
@foreach ($product_image as $product_image)
Upvotes: 1