From fdb68d2a1f09c852e557420a1688dec038311938 Mon Sep 17 00:00:00 2001 From: Oytun Tez Date: Sat, 12 Sep 2020 17:18:37 +0300 Subject: [PATCH] Use Env::get instead of env (#745) It conflicts with other `env()` global functions (such as CakePHP), and most of them don't handle closures. --- src/Mcamara/LaravelLocalization/LaravelLocalization.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mcamara/LaravelLocalization/LaravelLocalization.php b/src/Mcamara/LaravelLocalization/LaravelLocalization.php index e4000b5..fcbe356 100644 --- a/src/Mcamara/LaravelLocalization/LaravelLocalization.php +++ b/src/Mcamara/LaravelLocalization/LaravelLocalization.php @@ -5,6 +5,7 @@ use Illuminate\Config\Repository; use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Support\Str; +use Illuminate\Support\Env; use Mcamara\LaravelLocalization\Exceptions\SupportedLocalesNotDefined; use Mcamara\LaravelLocalization\Exceptions\UnsupportedLocaleException; @@ -1036,7 +1037,7 @@ protected function normalizeAttributes($attributes) */ protected function getForcedLocale() { - return env(static::ENV_ROUTE_KEY, function () { + return Env::get(static::ENV_ROUTE_KEY, function () { $value = getenv(static::ENV_ROUTE_KEY); if ($value !== false) {