Laravel error please help

-1

Good afternoon. I am working on an application in laravel and I get the following error:

 ErrorException Trying to get property of non-object (View: C:\wamp64\www\app-
 shop\resources\views\home.blade.php) 

How can I solve it thanks.

    
asked by Ivan Jimenez 07.12.2017 в 20:33
source

1 answer

0

The important thing here is to understand what that variable is $ detail that you are passing to the view from the controller.

At first glance I would say that the error is given when calling the product, which I assume is a relation with detail: {{ detail->product->featured_image_url }}

Maybe changing that line for the following solve it: {{ detail->product->first()->featured_image_url }}

You should add the first () every time you call product the way you are doing it, I see that you do it several times.

    
answered by 08.12.2017 в 05:10