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

add public connection() method to the Tenant DB manager interface

This commit is contained in:
Samuel Štancl 2022-10-25 12:53:31 +02:00
parent 5d688e6e5d
commit fe0a322b87
6 changed files with 34 additions and 17 deletions

View file

@ -154,7 +154,9 @@ class DatabaseConfig
/** @var Contracts\TenantDatabaseManager $databaseManager */
$databaseManager = app($databaseManagers[$driver]);
$databaseManager->setConnection($this->getTemplateConnectionName());
if ($databaseManager instanceof Contracts\StatefulTenantDatabaseManager) {
$databaseManager->setConnection($this->getTemplateConnectionName());
}
return $databaseManager;
}