Guest User

Untitled

a guest
Mar 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. {{ Auth::user()->role_id }}
  2.  
  3. {{ Auth::user()->role['name'] }}
  4.  
  5. {{ Auth::user()->role->name }}
  6.  
  7. User model:
  8.  
  9. public function roles()
  10. {
  11. return $this->hasOne('AppRole');
  12. }
  13.  
  14. Role model:
  15.  
  16. public function roles()
  17. {
  18. return $this->belongsToMany('AppUser');
  19. }
Add Comment
Please, Sign In to add comment