diff --git a/src/Events/EntityWasSaved.php b/src/Events/EntityWasSaved.php
index <HASH>..<HASH> 100644
--- a/src/Events/EntityWasSaved.php
+++ b/src/Events/EntityWasSaved.php
@@ -42,9 +42,15 @@ class EntityWasSaved
 
                     if ($relationValue instanceof ValueCollection) {
                         foreach ($relationValue as $value) {
+                            // Set attribute value's entity_id since it's always null,
+                            // because when RelationBuilder::build is called very early
+                            $value->setAttribute('entity_id', $entity->getKey());
                             $this->saveOrTrashValue($value);
                         }
                     } elseif (! is_null($relationValue)) {
+                        // Set attribute value's entity_id since it's always null,
+                        // because when RelationBuilder::build is called very early
+                        $relationValue->setAttribute('entity_id', $entity->getKey());
                         $this->saveOrTrashValue($relationValue);
                     }
                 }
Set attribute value's entity_id since it's always null