1

In my config/app.php file, the app environment variable it set like this: 'env' => env('APP_ENV', 'production'),. Meanwhile in the .env file, the app environment is set to APP_ENV=local.

It appears as though only the .env file matters. The app behaves as though the environment is local. php artisan env returns

Current application environment: local

Is there some instance when I should make modifications to the app.php file instead of the .env file? Should the variables in the app file just be ignored?

2 Answers 2

2

As in the docs env second argument

The second value passed to the env function is the "default value". This value will be used if no environment variable exists for the given key. So you get value from te env file.

Sign up to request clarification or add additional context in comments.

Comments

2

If you dont want to use .env settings then simply commented out or remove them. By doing this, system will pick your defined values from the config/app.php file.

For example: 'env' => env('APP_ENV', 'YOUR ENVIRONMENT VALUE')

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.