Skip to content

Commit 0b05561

Browse files
committed
also trigger the event when creating items
1 parent 98806a0 commit 0b05561

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/Library/CrudPanel/Traits/Create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ private function createManyEntries($entry, $relation, $relationMethod, $relation
316316
$this->createRelationsForItem($item, $relationInputs);
317317
}
318318

319-
// use the collection of sent ids to match agains database ids, delete the ones not found in the submitted ids.
319+
// use the collection of sent ids to match against database ids, delete the ones not found in the submitted ids.
320320
if (! empty($relatedItemsSent)) {
321321
// we perform the cleanup of removed database items
322-
$entry->{$relationMethod}()->whereNotIn($relatedModelLocalKey, $relatedItemsSent)->delete();
322+
$entry->{$relationMethod}()->whereNotIn($relatedModelLocalKey, $relatedItemsSent)->lazy()->each->delete();
323323
}
324324
}
325325
}

0 commit comments

Comments
 (0)