From 98c494a59bb0faab4b92e32b45004233e9637806 Mon Sep 17 00:00:00 2001 From: Marc <34892532+MarcHef@users.noreply.github.com> Date: Wed, 5 Dec 2018 21:28:15 +0100 Subject: [PATCH] Fix Database Connection (#26) * Fix Database Connection * Fix the indentation * Fix the indentation #2 --- src/Translatable.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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. *