We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb2354c commit 9b5c370Copy full SHA for 9b5c370
src/Translatable/Translatable.php
@@ -181,7 +181,8 @@ public function getNewTranslation(string $locale): Model
181
/** @var Model $translation */
182
$translation = new $modelName();
183
$translation->setAttribute($this->getLocaleKey(), $locale);
184
- $translation->setAttribute($this->translations()->getForeignKeyName(), $this->getKey());
+ $relation = $this->translations();
185
+ $translation->setAttribute($relation->getForeignKeyName(), $relation->getParentKey());
186
$this->translations->add($translation);
187
188
return $translation;
0 commit comments