From 49f8881f71848b762724905a397d05f120c4e06d Mon Sep 17 00:00:00 2001 From: Christophe Graniczny Date: Fri, 4 Mar 2016 07:07:41 +0000 Subject: [PATCH] Load env file if it matches the current environment --- configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.md b/configuration.md index b2b5de10286..70171c9891c 100644 --- a/configuration.md +++ b/configuration.md @@ -40,6 +40,8 @@ Your `.env` file should not be committed to your application's source control, s If you are developing with a team, you may wish to continue including a `.env.example` file with your application. By putting place-holder values in the example configuration file, other developers on your team can clearly see which environment variables are needed to run your application. +If the value of the `APP_ENV` variable is set before bootstraping the app, Laravel will try to load a file that matches this environment and will fallback to the `.env` file. This variable can be set in a server configuration or in a command line tool. For example, the phpunit configuration file set `APP_ENV=testing`, Laravel will look for a `.env.testing` file first. If the file does not exist, the`.env` file will be used. + ### Determining The Current Environment