Friday, March 3, 2017

Laravel Error: "Trying to get property of non-object"

I have a table what populates from database:

@extends('layouts.master')
@section('main')
@parent
<table border=1 align=center;>
<tr><td rowspan=10><img src="media/productimg/question.jpg" width=250px></td>
<th>Márka</th><td colspan=3></td></tr>
<tr><th>Beszállító</th><td colspan=3></td></tr>
<tr><th></th>
<th colspan=3></th></tr>
<tr><th>Nettó beszerzési ár</th><td> Ft</td>
<th rowspan=2>Ár</th><td rowspan=2> Ft</td></tr>
<tr><th>Bruttó beszerzési ár</th><td> Ft</td>
<tr><th>Vonalkód</th><td></td><th>Raktáron</th><td> </td></tr>
<tr><th>Elhelyezkedés</th><td> </td><th>Küszöb</th><td> </td></tr>
<tr><th>Utolsó rendelés</th><td> NA </td>
<th>Utolsó vásárlás</th><td> NA </td></tr>
<tr><td colspan=5><a href="stock_productimageupload.php"><button class="button">Kép szerkesztése</button></a>
<a href="stock_productupdate.php"><button class="button">Termék szerkesztése</button></a>
<a href="stock_productcountupdate.php"><button class="button">Mennyiség szabályozása</button></a></td></tr>
</table>
@endsection

And I got this error:

ErrorException in 20d205ed160f36c734b8252e44ac81bfa0977988.php line 6: Trying to get property of non-object

If I replace the table with

<?php print_r($productdetails);?>

I got the the array with the good values.

What going wrong?



via Feralheart

Advertisement