diff --git a/src/Database/Relations/AttachMany.php b/src/Database/Relations/AttachMany.php index aca72342c..36172083e 100644 --- a/src/Database/Relations/AttachMany.php +++ b/src/Database/Relations/AttachMany.php @@ -41,7 +41,7 @@ public function setSimpleValue($value) { // Nulling the relationship if (!$value) { - $this->parent->setRelation($this->relationName, null); + $this->parent->unsetRelation($this->relationName); if ($this->parent->exists) { $this->parent->bindEventOnce('model.afterSave', function() { diff --git a/src/Database/Relations/HasMany.php b/src/Database/Relations/HasMany.php index dbad14e30..27c74b7bd 100644 --- a/src/Database/Relations/HasMany.php +++ b/src/Database/Relations/HasMany.php @@ -37,7 +37,7 @@ public function setSimpleValue($value) { // Nulling the relationship if (!$value) { - $this->parent->setRelation($this->relationName, null); + $this->parent->unsetRelation($this->relationName); if ($this->parent->exists) { $this->parent->bindEventOnce('model.afterSave', function() {