Sometimes when we upload files to AWS Beanstalk it is necessary to instruct whether the code will take the Environment variables mentioned in the code via .env file present on the server or through Environment Properties mentioned in Beanstalk configuration. So here is a solution: If you want the code to take the env variables from the .env file simply use env() parameter as shown in the green line below: If you want the code to take env variables from variables mentioned in Configuration > Software > Environment Properties of Beanstalk than use the $_SERVER parameter as shown above in red Line. Written by
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners