Skip to content

Commit

Permalink
fix(*): 修复拓展包填充逻辑错误
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 13, 2018
1 parent 46e7b66 commit e07542c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function run()
]);

$roles = Role::whereIn('name', ['founder'])->get();
$roles->each->abilities()->syncWithoutDetaching([$ability]);
$roles->each(function (Role $role) use ($ability) {
$role->abilities()->syncWithoutDetaching($ability);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function run()
$ability->save();

$roles = Role::whereIn('name', ['founder', 'owner'])->get();
$roles->each->abilities()->syncWithoutDetaching([$ability]);
$roles->each(function (Role $role) use ($ability) {
$role->abilities()->syncWithoutDetaching($ability);
});
}
}

0 comments on commit e07542c

Please sign in to comment.