In the Elastic beanstalk console
Configuration > Software Configuration > Environment Properties
You'll see a screen like this
You can fill in your environment variables here.
This means you don't need to set up environment variables in .config
files, nor do you need to commit your .env
file to VCS.
Environment variables entered into the console are copied to any EC2 boxes which elastic beanstalk manages for you within that application/environment.
The .env file in Laravel is designed to facilitate development and as such shouldn't be used in production. Anything in that file should be created as real environment variables and the .env file need not be present.
The .env file (via phpdotenv) simply creates environment variables at runtime, which isn't necessary if the environment variables actually exist already.
.config
files should be available assnippets
in the VCS - lacking your credentials of course. Credentials should never be stored anywhere, and exist only at 1 given location at a time, sans duplication. However, parameters without credentials are rarely an issue. – Ohgodwhysnippets
– Sidharth