Skip to content

Commit 6e368eb

Browse files
committed
fix hardcoded locale column name
1 parent e964450 commit 6e368eb

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)