mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:54:05 +00:00
Fix Database Sessions
This commit is contained in:
parent
411d486282
commit
9a412bf86e
1 changed files with 2 additions and 2 deletions
|
|
@ -38,7 +38,7 @@ class DatabaseManager
|
||||||
*/
|
*/
|
||||||
public function connectToTenant(TenantWithDatabase $tenant)
|
public function connectToTenant(TenantWithDatabase $tenant)
|
||||||
{
|
{
|
||||||
$this->database->purge('tenant');
|
$this->database->disconnect('tenant');
|
||||||
$this->createTenantConnection($tenant);
|
$this->createTenantConnection($tenant);
|
||||||
$this->setDefaultConnection('tenant');
|
$this->setDefaultConnection('tenant');
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +49,7 @@ class DatabaseManager
|
||||||
public function reconnectToCentral()
|
public function reconnectToCentral()
|
||||||
{
|
{
|
||||||
if (tenancy()->initialized) {
|
if (tenancy()->initialized) {
|
||||||
$this->database->purge('tenant');
|
$this->database->disconnect('tenant');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setDefaultConnection($this->config->get('tenancy.database.central_connection'));
|
$this->setDefaultConnection($this->config->get('tenancy.database.central_connection'));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue