Commit 21f02473 authored by Ryan Chan's avatar Ryan Chan Committed by Nicolas Widart

use “where” clause for fetching translation by key instead of “whereKey” (#331)

Laravel 5.4 compatibility
parent f450282e
...@@ -17,7 +17,7 @@ class EloquentTranslationRepository extends EloquentBaseRepository implements Tr ...@@ -17,7 +17,7 @@ class EloquentTranslationRepository extends EloquentBaseRepository implements Tr
{ {
$locale = $locale ?: app()->getLocale(); $locale = $locale ?: app()->getLocale();
$translation = $this->model->whereKey($key)->with('translations')->first(); $translation = $this->model->where('key', $key)->with('translations')->first();
if ($translation && $translation->hasTranslation($locale)) { if ($translation && $translation->hasTranslation($locale)) {
return $translation->translate($locale)->value; return $translation->translate($locale)->value;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment