Created
April 8, 2020 19:57
-
-
Save Frolki1-Dev/b3a148b77d778cdc0fcd7b66b83604ff to your computer and use it in GitHub Desktop.
[Laravel] Load a different .env file
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
/** | |
* Put this line in index.php | |
*/ | |
$hostname = gethostname(); | |
if (($d = strpos($hostname, '.')) !== false) { | |
$hostname = substr($hostname, 0, $d); | |
} | |
putenv('APP_ENV=' . $hostname); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment