Skip to content

Commit

Permalink
Fix #157
Browse files Browse the repository at this point in the history
Fix #157
  • Loading branch information
santigarcor committed Jul 11, 2017
1 parent 0783504 commit 941f776
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Laratrust/Traits/LaratrustPermissionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function bootLaratrustPermissionTrait()

static::deleting(function ($permission) {
if (method_exists($permission, 'bootSoftDeletes') && $permission->forceDeleting) {
return true;
return;
}

$permission->roles()->sync([]);
Expand Down
3 changes: 1 addition & 2 deletions src/Laratrust/Traits/LaratrustRoleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public static function bootLaratrustRoleTrait()
{
$flushCache = function ($role) {
$role->flushCache();
return true;
};

// If the role doesn't use SoftDeletes.
Expand All @@ -91,7 +90,7 @@ public static function bootLaratrustRoleTrait()

static::deleting(function ($role) {
if (method_exists($role, 'bootSoftDeletes') && $role->forceDeleting) {
return true;
return;
}

$role->permissions()->sync([]);
Expand Down
2 changes: 1 addition & 1 deletion src/Laratrust/Traits/LaratrustTeamTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function bootLaratrustTeamTrait()
{
static::deleting(function ($team) {
if (method_exists($team, 'bootSoftDeletes') && $team->forceDeleting) {
return true;
return;
}

foreach (array_keys(Config::get('laratrust.user_models')) as $key) {
Expand Down
6 changes: 1 addition & 5 deletions src/Laratrust/Traits/LaratrustUserTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ public static function bootLaratrustUserTrait()
{
$flushCache = function ($user) {
$user->flushCache();

return true;
};

// If the user doesn't use SoftDeletes.
Expand All @@ -119,13 +117,11 @@ public static function bootLaratrustUserTrait()

static::deleting(function ($user) {
if (method_exists($user, 'bootSoftDeletes') && !$user->forceDeleting) {
return true;
return;
}

$user->roles()->sync([]);
$user->permissions()->sync([]);

return true;
});
}

Expand Down

0 comments on commit 941f776

Please sign in to comment.