Laravel 5 Dotenv for specific subdomain
I have a few subdomain in my laravel 5 application, each sub domain have a specific configuration, like mail, nocaptcha, etc. how to set .env file to work with my-specific subdomain ? Yes, you can use separate .env files for each subdomain so if you use env variables in your config it will work without great modifications. Create bootstrap/env.php file with the following content: <?php $app->detectEnvironment(function () use ($app) { if (!isset($_SERVER['HTTP_HOST'])) { Dotenv::load($app['path.base'], $app->environmentFile()); } $pos = mb_strpos($_SERVER['HTTP_HOST'], '.'); $prefix = ''; if (