My question is quite similar to this StackOverflow thread. But there was no proper solution for that.
I am using two php applications separately for front-end and back-end(API) on same server. There are two .env files separately for each. When there are DB configurations on both env files, when there is call from front-end to back-end, API supposed to use back-end .env file's DB configurations. Instead, it uses front-end DB configurations.
How can I prevent using front-end DB configurations?