Closed pixsolution closed 9 months ago
I realized that loading an env statically in bootstrap/app.php works $app->loadEnvironmentFrom('.env.domain2.com'); but I need to manage it dynamically, I have tried the following from a controller but it doesn't work
$app = app(); $app->loadEnvironmentFrom('.env.domain2.com'); $kernel = app()->make(Kernel::class); $kernel->bootstrap();
hi,
what do yuo have in the supergloabl $_SERVER['SERVER_NAME']?
maybe you simply have to use 'HTTP_HOST' as pointed out in the docs,
let me know
cheers
giacomo
I close the issue as you didn't reply for a while :) If there are other problems, please reopen
Thanks
Giacomo
Hello
With this package, how can I change the database from the code? for example from a Laravel controller? I have tried to make a request with http client: example $response = Http::get('domain2.com'); but it always return defaults database of the first .env (domain1.com) that I've in my project, it does not change me to the other domains/env that I have configured with the package How can I do?
Regards