diff --git a/src/Translatable/Traits/Relationship.php b/src/Translatable/Traits/Relationship.php index 1a4cc1c..77f41cd 100644 --- a/src/Translatable/Traits/Relationship.php +++ b/src/Translatable/Traits/Relationship.php @@ -65,7 +65,11 @@ public function translation(): HasOne { return $this ->hasOne($this->getTranslationModelName(), $this->getTranslationRelationKey()) - ->where($this->getLocaleKey(), $this->localeOrFallback()); + ->ofMany([ + $this->getTranslationRelationKey() => 'max', + ], function ($query) { + $query->where($this->getLocaleKey(), $this->localeOrFallback()); + }); } protected function localeOrFallback()