How does Laravel parse the .env file?
问题 I would like to mimic the way a Laravel application has it's environment variables set via a .env file. APP_ENV=local DB_DATABASE=fruits DB_USERNAME=fruituser DB_PASSWORD=secretpassword So it can then set default fallbacks in config.php like this: return [ 'env' => env('APP_ENV', 'production'), ]; However I am having trouble digging through the framework code to find the bit where it parses the text in .env and turns it into proper PHP variables. I have found the definition of the env()