diff --git a/bootstrap/start.php b/bootstrap/start.php index ed9cfbbb..866ccc61 100644 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -3,7 +3,16 @@ $app = new Illuminate\Foundation\Application; $env = $app->detectEnvironment( function () { - return getenv('APP_ENV') ?: 'local'; + + // Defined in the server configuration + if ( isset( $_SERVER['APP_ENVIRONMENT'] ) ) { + return $_SERVER['APP_ENVIRONMENT']; + + // Look for ./environment.php + } elseif ( file_exists( __DIR__ . '/environment.php' ) ) { + return include __DIR__ . '/environment.php'; + } + }); $app->bindInstallPaths(require __DIR__.'/paths.php');