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.
php artisan config:clear
this should clear the cached config. You can also runphp artisan config:cache
to refresh the existing cache – Rob Biermann