Skip to content

Instantly share code, notes, and snippets.

@Frolki1-Dev
Created April 8, 2020 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frolki1-Dev/b3a148b77d778cdc0fcd7b66b83604ff to your computer and use it in GitHub Desktop.
Save Frolki1-Dev/b3a148b77d778cdc0fcd7b66b83604ff to your computer and use it in GitHub Desktop.
[Laravel] Load a different .env file
/**
* 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