Skip to content

Commit 8fb7d18

Browse files
committed
Fix premature return in performDeleteOnRelations that skips remaining relation cleanup when a many-to-many has detach disabled
1 parent beb9293 commit 8fb7d18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Database/Concerns/HasRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ protected function performDeleteOnRelations()
906906
// Belongs-To-Many should clean up after itself by default
907907
if (in_array($type, ['belongsToMany', 'morphToMany', 'morphedByMany'])) {
908908
if (!Arr::get($options, 'detach', true)) {
909-
return;
909+
continue;
910910
}
911911

912912
$this->{$name}()->detach();

0 commit comments

Comments
 (0)