Skip to content

Commit 49f8881

Browse files
author
Christophe Graniczny
committed
Load env file if it matches the current environment
1 parent 3c1ff42 commit 49f8881

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Your `.env` file should not be committed to your application's source control, s
4040

4141
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.
4242

43+
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.
44+
4345
<a name="determining-the-current-environment"></a>
4446
### Determining The Current Environment
4547

0 commit comments

Comments
 (0)