Skip to content

Commit 4ce199d

Browse files
authored
Merge pull request #146 from Astrotomic/issue-145
fix hardcoded locale column name
2 parents e964450 + 6e368eb commit 4ce199d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Translatable/Traits/Relationship.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ public function translation(): HasOne
6565
{
6666
return $this
6767
->hasOne($this->getTranslationModelName(), $this->getTranslationRelationKey())
68-
->where('locale', $this->localeOrFallback());
68+
->where($this->getLocaleKey(), $this->localeOrFallback());
6969
}
7070

7171
private function localeOrFallback()
7272
{
73-
return $this->useFallback() && ! $this->translations()->where('locale', $this->locale())->exists()
73+
return $this->useFallback() && ! $this->translations()->where($this->getLocaleKey(), $this->locale())->exists()
7474
? $this->getFallbackLocale()
7575
: $this->locale();
7676
}

0 commit comments

Comments
 (0)