Home  >  Q&A  >  body text

ErrorException Trying to get property 'nom_service' of non-object

Please help I have tried the biggest approach with no results, I am a beginner in Laravel! ! !

liste.blade.php

<td> {{$data->candidature->demande}} </td>

        <td> {{$data->candidature->service->nom_service}} </td>

        <td> {{$data->nom}} </td>

P粉662089521P粉662089521259 days ago606

reply all(1)I'll reply

  • P粉359850827

    P粉3598508272024-02-27 12:05:26

    If the service is indeed an array, as mentioned in the comments, try this:

    @foreach ($data->candidature->service as $service)
         {{$service->nom_service}} 
    @endforeach

    reply
    0
  • Cancelreply