1 | initial version |
In the register() method of the file, add the following code:
use Illuminate\Support\Facades\DB;
public function register()
{
$request = app('request');
if ($request->server('HTTP_HOST') == 'yourdomain.com') {
config(['database.default' => 'yourdatabase']);
DB::reconnect();
}
}
This code checks the HTTP host and changes the default database and reconnects to it.