lundi 16 janvier 2017

How to access related model inside pagination (Laravel 5.1)

@foreach($tasks as $t)
   // works fine
   // Trying to get property of non-object
   // something similar error.
@endforeach

Given the following data structure, how could I access the last_active field of the related model?

dump

Task:

public function client(){
    return $this->belongsTo('\App\Client');
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire