lundi 31 octobre 2016

Acces collection on laravel 5.2

I'm using entrust for my roles and permissions on laravel 5.2 and I have this on my controller:

$user = Auth::user();
    $rol = $user->roles;
    dd($rol);

in my User model:

 public function roles(){
    return $this->belongsToMany('Nini\Role','role_user');
}

And get this: Snapshot

I'm tryng to acces and show "display_name" on my view and i can't, help! Thanks in advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2eO989S
via IFTTT

Aucun commentaire:

Enregistrer un commentaire