Simplified env detection closure

This commit is contained in:
Elliot Hesp
2014-11-27 20:10:17 +00:00
parent c0f5c5f7fc
commit bf1858cd4c

View File

@@ -25,13 +25,9 @@ $app = new Illuminate\Foundation\Application;
*/
$env = $app->detectEnvironment(function() {
// Take care of Heroku deployment for us.
if ($envName = getenv('ENV')) {
return $envName;
}
// Always fall back to local.
return 'local';
// Set the environment if set, otherwise it's local
return getenv('ENV') ?: 'local';
});
/*