Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function roles()
- {
- return $this
- ->belongsToMany('AppRole')
- ->withTimestamps();
- }
- public function users(){
- return $this
- ->belongsToMany('AppUser')
- ->withTimestamps();
- }
- public function up()
- {
- Schema::create('role_user', function (Blueprint $table) {
- $table->increments('id');
- $table->integer('role_id')->unsigned();
- $table->integer('user_id')->unsigned();
- $table->timestamps();
- });
- }
- {{ Auth::user()->nombre }}
- {{ Auth::user()->roles()->nombre }}
Add Comment
Please, Sign In to add comment