Commit e8f48ae8 authored by Marcos Albano's avatar Marcos Albano 💬

Adicionado relacionamentos dos Models Role e Permission com User

parent 782b6abf
......@@ -12,13 +12,13 @@ class Role extends Model
'name', 'description',
];
// public function users()
// {
// return $this->belongsToMany(User::class, 'id');
// }
public function users()
{
return $this->belongsToMany(User::class, 'id');
}
// public function permissions()
// {
// return $this->belongsToMany(Permission::class, 'id');
// }
public function permissions()
{
return $this->belongsToMany(Permission::class, 'id');
}
}
......@@ -28,9 +28,9 @@ class User extends Authenticatable
'password', 'remember_token',
];
// public function roles()
// {
// return $this->belongsToMany(Role::class, 'id');
// }
public function roles()
{
return $this->belongsToMany(Role::class, 'id');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment