Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Configuration/DotEnvConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ public function __construct($path = '.')
*/
private function env($key, $default = null)
{
$value = $_ENV[$key] ?? null;

// Fallback for frameworks like Laravel as the $_ENV method might not work in all
// circumstances. ie when running scheduled jobs.
if (function_exists('env') && is_callable('env')) {
$value = call_user_func('env', $key) ?? null;
} else {
$value = $_ENV[$key] ?? null;
}

if ($value === false) {
return $default;
Expand Down