diff --git a/assets/config.php b/assets/config.php index 2a54e0b9..b8a759c9 100644 --- a/assets/config.php +++ b/assets/config.php @@ -47,6 +47,11 @@ return [ */ 'template_tenant_connection' => null, + /** + * Tenant host connection name used to create a temporary connection for creating, deleting database + */ + 'tenant_host_connection_name' => 'tenant_host_connection', + /** * Tenant database names are created like this: * prefix + tenant_id + suffix. diff --git a/src/Database/DatabaseConfig.php b/src/Database/DatabaseConfig.php index d26e6342..bf002af4 100644 --- a/src/Database/DatabaseConfig.php +++ b/src/Database/DatabaseConfig.php @@ -101,9 +101,9 @@ class DatabaseConfig ?? config('tenancy.database.central_connection'); } - public function getTenantHostConnectionName(): string + public function getTenantHostConnectionName(): ?string { - return 'tenant_host_connection'; + return config('tenancy.database.tenant_host_connection_name'); } /**