diff --git a/src/Translatable.php b/src/Translatable.php index a757b2c..e704b60 100644 --- a/src/Translatable.php +++ b/src/Translatable.php @@ -281,6 +281,7 @@ public function translations() public function translationModel() { $translation = new TranslationModel(); + $translation->setConnection($this->getI18nConnection()); $translation->setTable($this->getI18nTable()); $translation->setKeyName($this->getForeignKey()); $translation->setLocaleKey($this->getLocaleKey()); @@ -442,6 +443,16 @@ public function getWithFallback() return TranslatableConfig::withFallback(); } + /** + * Get the i18n connection name associated with the model. + * + * @return string + */ + public function getI18nConnection() + { + return $this->getConnectionName(); + } + /** * Get the i18n table associated with the model. *