Skip to content

Commit

Permalink
Merge pull request #418 from Tofandel/patch-1
Browse files Browse the repository at this point in the history
Fix new translation is missing the relation id for saving
  • Loading branch information
Gummibeer authored Jul 10, 2024
2 parents 250f9b3 + a52698e commit 979d18d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Translatable/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public function getNewTranslation(string $locale): Model
/** @var Model $translation */
$translation = new $modelName();
$translation->setAttribute($this->getLocaleKey(), $locale);
$translation->setAttribute($this->getTranslationRelationKey(), $this->getKey());
$this->translations->add($translation);

return $translation;
Expand Down

0 comments on commit 979d18d

Please sign in to comment.