Skip to main content

Posts

Featured

Laravel 5.4 .env files — how they autoload

Laravel 5.4 .env files — how they autoload up votedown votefavorite Laravel 5.4 .env files How do I load the .env.production file vs .env.dev file or the base .env file?


down voteaccept In my vagrant box I had ... setenv:-'APP_ENV dev' After creating a .env.dev , I noticed it was not loading that file! WHY? HOW!? Well, the bootstrap is auto detecting the app environment from the servers APP_ENV environment variable which can be set on the server or virtual host level of your server. https://laravel.com/docs/5.4/configuration#environment-configuration The code that does it... vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php /** * Detect if a custom environment file matching the APP_ENV exists. * * @param \Illuminate\Contracts\Foundation\Application $app * @return void */protected

Latest Posts

xdebug with phpstorm and puphpet vagrant box

session_regenerate_id causing fatal error in Php 7