Skip to content

Commit

Permalink
undo sync role and permission
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafamaklad committed Jan 24, 2018
1 parent 4869131 commit d75a0c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Traits/HasPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public function givePermissionTo(...$permissions)
*/
public function syncPermissions(...$permissions)
{
foreach ($this->permissions as $permission) {
$permission->users()->detach($this);
}
$this->permissions()->detach();

return $this->givePermissionTo($permissions);
}
Expand Down
4 changes: 1 addition & 3 deletions src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ public function removeRole($role)
*/
public function syncRoles(...$roles)
{
foreach ($this->roles as $role) {
$role->users()->detach($this);
}
$this->roles()->detach();

return $this->assignRole($roles);
}
Expand Down

0 comments on commit d75a0c5

Please sign in to comment.