Skip to content

Commit e07542c

Browse files
committed
fix(*): 修复拓展包填充逻辑错误
1 parent 46e7b66 commit e07542c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/slimkit-plus-checkin/database/seeds/AbilitySeeder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function run()
4141
]);
4242

4343
$roles = Role::whereIn('name', ['founder'])->get();
44-
$roles->each->abilities()->syncWithoutDetaching([$ability]);
44+
$roles->each(function (Role $role) use ($ability) {
45+
$role->abilities()->syncWithoutDetaching($ability);
46+
});
4547
}
4648
}

packages/slimkit-plus-feed/database/seeds/AbilityTableSeeder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function run()
4141
$ability->save();
4242

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

0 commit comments

Comments
 (0)