You can have multiple .env files in your project and use your own logic to determine which one out of them Laravel will load when bootstrapping. That’s not what I’m asking about here.
About 95% of my .env settings are usually identical for my local and production environments, but a few are environment-specific. Making any changes to common settings requires making the same changes in all environments separately.
It would be very useful to have a base .env file for the common settings and additionally an .env.[environment] file for each environment for the environment-specific settings. With encryption, you could add the base file to your SVN so that changes propagate automatically, without affecting the environment-specific settings.
But from everything I can find online, this is just not possible. You can load either a generic .env file or an environment-specific .env.[environment] file, but never both.
Is this correct? Is there really no way to tell Laravel to load and combine several .env files while bootstrapping, making the settings in all of them available to use in config files?
(This is annoying me particularly right at the moment, since I’m working on a project that will be hosted on a shared host with no access except via FTP, so every time I change an environment setting, I have to either (a) change all the production-specific settings to their production values, save, upload, and then change them back to their local-specific values; or (b) have completely separate .env files for local and production, and then remember to change the setting in both .env files and upload the production one to the server. Both options are annoying.)