Guest User

Untitled

a guest
May 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public function roles()
  2. {
  3. return $this
  4. ->belongsToMany('AppRole')
  5. ->withTimestamps();
  6. }
  7.  
  8. public function users(){
  9. return $this
  10. ->belongsToMany('AppUser')
  11. ->withTimestamps();
  12. }
  13.  
  14. public function up()
  15. {
  16. Schema::create('role_user', function (Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('role_id')->unsigned();
  19. $table->integer('user_id')->unsigned();
  20. $table->timestamps();
  21. });
  22. }
  23.  
  24. {{ Auth::user()->nombre }}
  25.  
  26. {{ Auth::user()->roles()->nombre }}
Add Comment
Please, Sign In to add comment