Last active
April 24, 2019 18:28
-
-
Save di3/c9af6fa9400a40fc6ab439f4ee238b8b to your computer and use it in GitHub Desktop.
laravel bootstrap/app.php for .env handling
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 | |
/* | |
.env | |
APP_ENV=local | |
.local.env | |
APP_DEBUG=true | |
.production.env | |
APP_DEBUG=false | |
*/ | |
require_once(__DIR__ . '/../vendor/autoload.php'); | |
//dynamic .env handling | |
if (file_exists(__DIR__ . '/../.env')) { | |
Dotenv::load(__DIR__ . '/../'); | |
if (getenv('APP_ENV') && file_exists(__DIR__ . '/../.' . getenv('APP_ENV') . '.env')) { | |
Dotenv::load(__DIR__ . '/../', '.' . getenv('APP_ENV') . '.env'); | |
} | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment