You don't need to mess with any env variables. You can adjust the configs at runtime.
Just add a new connection to the configuration at runtime. Then set the default to that new name.
config()->set('database.connections.yournewconnection', [ array like in config ]);
config()->set('database.default', 'yournewconnection');
Then it should be using that new connection by default.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community