pls help I tried the maximum ways but no result, I'm beginner in laravel!!! the same error everytime (ErrorException Trying to get property 'nom_service' of non-object)
liste.blade.php
<td> {{$data->candidature->demande}} </td>
<td> {{$data->candidature->service->nom_service}} </td>
<td> {{$data->nom}} </td>
CodePudding user response:
If service is indeed an array as said in the comments, try the following:
@foreach ($data->candidature->service as $service)
<td> {{$service->nom_service}} </td>
@endforeach