1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 21:54:03 +00:00

Overwriting the connection doesn't matter, it just changes the DB

This commit is contained in:
Samuel Štancl 2019-09-21 11:39:31 +02:00
parent ed308b1650
commit 3cd97bdcab

View file

@ -64,10 +64,8 @@ class DatabaseManager
// Create the database connection.
$based_on = $this->getBaseConnection($connectionName);
$this->app['config']["database.connections.$connectionName"] = $this->app['config']['database.connections.' . $based_on];
// todo don't overwrite database.connections.$connectionName
// Change database name.
// todo tenant-specific connections without any DB name changes?
$databaseName = $this->getDriver($connectionName) === 'sqlite' ? database_path($databaseName) : $databaseName;
$this->app['config']["database.connections.$connectionName.database"] = $databaseName;
}