diff --git a/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php b/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php index a371c9f8d57f..4967ca7088f6 100644 --- a/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php +++ b/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php @@ -16,6 +16,8 @@ public function bootstrap(Application $app) { try { + Dotenv::makeMutable(); + Dotenv::load($app['path.base'], $app->environmentFile()); } catch (InvalidArgumentException $e) diff --git a/src/Illuminate/Foundation/Testing/ApplicationTrait.php b/src/Illuminate/Foundation/Testing/ApplicationTrait.php index 0fb338cf5022..dd2ee1771813 100644 --- a/src/Illuminate/Foundation/Testing/ApplicationTrait.php +++ b/src/Illuminate/Foundation/Testing/ApplicationTrait.php @@ -1,5 +1,6 @@ app = $this->createApplication(); } diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 2a08e143d6bc..3f306aff93f6 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -559,9 +559,9 @@ function view($view = null, $data = array(), $mergeData = array()) */ function env($key, $default = null) { - $value = getenv($key); + $value = Dotenv::findEnvironmentVariable($key); - if ($value === false) return value($default); + if ($value === null) return value($default); switch (strtolower($value)) {