diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index d3312cfc73e9..1c95f63245a1 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -8,6 +8,7 @@ use Dotenv\Environment\DotenvFactory; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Support\HigherOrderTapProxy; +use Dotenv\Environment\Adapter\PutenvAdapter; use Dotenv\Environment\Adapter\EnvConstAdapter; use Dotenv\Environment\Adapter\ServerConstAdapter; @@ -642,7 +643,7 @@ function env($key, $default = null) static $variables; if ($variables === null) { - $variables = (new DotenvFactory([new EnvConstAdapter, new ServerConstAdapter]))->createImmutable(); + $variables = (new DotenvFactory([new EnvConstAdapter, new PutenvAdapter, new ServerConstAdapter]))->createImmutable(); } return Option::fromValue($variables->get($key))