Skip to content

Commit 9b5c370

Browse files
authored
Update src/Translatable/Translatable.php
1 parent fb2354c commit 9b5c370

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Translatable/Translatable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ public function getNewTranslation(string $locale): Model
181181
/** @var Model $translation */
182182
$translation = new $modelName();
183183
$translation->setAttribute($this->getLocaleKey(), $locale);
184-
$translation->setAttribute($this->translations()->getForeignKeyName(), $this->getKey());
184+
$relation = $this->translations();
185+
$translation->setAttribute($relation->getForeignKeyName(), $relation->getParentKey());
185186
$this->translations->add($translation);
186187

187188
return $translation;

0 commit comments

Comments
 (0)