From e4bdf7c6a7ff5c39412d9c345b9e2a5cd37b7bd4 Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 3 Dec 2020 12:53:23 +0100 Subject: [PATCH] Added check for app.cache enabled before return Cache Decorator Repository --- Modules/Translation/Providers/TranslationServiceProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/Translation/Providers/TranslationServiceProvider.php b/Modules/Translation/Providers/TranslationServiceProvider.php index 49c9116d6..666702450 100644 --- a/Modules/Translation/Providers/TranslationServiceProvider.php +++ b/Modules/Translation/Providers/TranslationServiceProvider.php @@ -115,6 +115,10 @@ private function registerBindings() $this->app->bind(TranslationRepository::class, function () { $repository = new EloquentTranslationRepository(new Translation()); + if (! config('app.cache')) { + return $repository; + } + return new CacheTranslationDecorator($repository); });