Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a suggested list of values for Laravel's APP_ENV variable (found in the .env file)?

Tags:

laravel

I can't seem to find any sort of official list of the APP_ENV variable in the .env file. In practice I've used local, dev, development, staging, and production. And I feel like this works okay... and I've even seen some of these used by other prominent Laravel developers. However I'd feel much more confident if there was a standard. Is there a PSR standard that defines environment names? Or maybe some Laravel documentation I'm missing?

like image 534
Spencer O'Reilly Avatar asked Aug 20 '19 22:08

Spencer O'Reilly


People also ask

What is the .env file?

The . env file contains the individual user environment variables that override the variables set in the /etc/environment file. You can customize your environment variables as desired by modifying your . env file.

Where can I find .env files?

env file is placed at the base of the project directory. Project directory can be explicitly defined with the --file option or COMPOSE_FILE environment variable.


Video Answer


1 Answers

As far as I know, only local, testing and production are standard, because the Illuminate/Foundation/Application class contains the methods isLocal(), runningUnitTests() and isProduction() for checking them.

like image 78
Augusto Moura Avatar answered Oct 05 '22 01:10

Augusto Moura