Created
April 15, 2014 14:31
-
-
Save adamwathan/10737348 to your computer and use it in GitHub Desktop.
Better default for Laravel environment detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// bootstrap/start.php | |
/* | |
|-------------------------------------------------------------------------- | |
| Detect The Application Environment | |
|-------------------------------------------------------------------------- | |
| | |
| Laravel takes a dead simple approach to your application environments | |
| so you can just specify a machine name for the host that matches a | |
| given environment, then we will automatically detect it for you. | |
| | |
*/ | |
$env = $app->detectEnvironment(function() { | |
return getenv('APPLICATION_ENV') ?: 'local'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment