4
votes

I have deployed my Laravel application to AWS Beanstalk. I also connected CodePipeline for automatic deployment. As I have multiple environments (staging, testing, production) I want to use AWS Elastic Beanstalk environment variables for different environments. However, when I write my own variables to elastic beanstalk configuration and I dd(config('app.env')), it prints "production" instead of "staging". How can I fix this problem? Thanks in advance!

P.s: I also removed the .env file manually, it still did not work.

env

1
I think you have your settings cached. If you run php artisan config:clear this should clear the cached config. You can also run php artisan config:cache to refresh the existing cacheRob Biermann
@RobBiermann unfortunately it did not work :(Javid Abbasov

1 Answers

2
votes

Amazon first check it's global variables (google it pls) and then refers to laravel .env file variables