- DB::transaction(function () use ($idsByType) {
- foreach ($idsByType as $type => $ids) {
- foreach (array_chunk($ids, 1000) as $idChunk) {
- DB::table('joint_permissions')
- ->where('entity_type', '=', $type)
- ->whereIn('entity_id', $idChunk)
- ->delete();
- }
+ foreach ($idsByType as $type => $ids) {
+ foreach (array_chunk($ids, 1000) as $idChunk) {
+ DB::table('joint_permissions')
+ ->where('entity_type', '=', $type)
+ ->whereIn('entity_id', $idChunk)
+ ->delete();