Skip to content

Commit

Permalink
fix: changed config to cache
Browse files Browse the repository at this point in the history
  • Loading branch information
alaamebrahim committed Nov 13, 2020
1 parent 34f2712 commit 64ecdae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LaravelTranslationsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ private function registerConfig()

protected function registerBladeDirective()
{
Cache::remember('translations', cache('ame-translations.cache_ttl'), function () {
Cache::remember('translations', config('ame-translations.cache_ttl'), function () {
$translations = collect();
foreach (config('ame-translations.supported-locales') as $locale) { // suported locales
foreach (config('ame-translations.supported-locales') as $locale) { // supported locales
$translations[$locale] = [
'php' => $this->phpTranslations($locale),
'json' => $this->jsonTranslations($locale),
Expand All @@ -44,7 +44,7 @@ protected function registerBladeDirective()
});

Blade::directive('translations', function () {
return '<script>window._translations =' . cache('translations') . '</script>';
return '<script>window._translations =' . Cache::get('translations') . '</script>';
});
}

Expand Down

0 comments on commit 64ecdae

Please sign in to comment.