Trying to get property of non-object laravel

Par Elizo Chryst, il y a 8 ans


J'ai cette erreur, en production alorsqu'en local tout marchait bien, ca peut etre du a quoi? Merci

<?php $comments->load('user'); ?> @foreach($comments as $comment) <ul class="media-list"> <li class="media" style="border-bottom: 1px #d5d5d5 solid;"> <div class="media-body"> @if(App\User::where('id', $comment->user_id)->first()) <a href="{{ url($comment->username) }}">{{ $comment->username }}</a> @else {{ $comment->username }} @endif <p>@if(isset($infos) && $infos === true) <em><a href="{{ action('InfosUtilesController@show', $comment->infos) }}">{{ $comment->infos->name }}</a></em> @endif </p> {{ $comment->content }} </div> <br> </li> </ul> @endforeach <br>

1 réponse

rueduphp, il y a 7 ans

Que fiche le load dans une vue ? A mon avis, le foreach ne renvoie pas des objets. Il nous faudrait le code du controller.