mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 21:14:03 +00:00
partial database config for template
This commit is contained in:
parent
2e3b8f7108
commit
bc27a93eda
2 changed files with 33 additions and 3 deletions
|
|
@ -109,12 +109,17 @@ class DatabaseConfig
|
|||
}
|
||||
|
||||
if ($template = config('tenancy.database.template_tenant_connection')) {
|
||||
return is_array($template) ? $template : config("database.connections.{$template}");
|
||||
return is_array($template) ? array_merge($this->getCentralConnection(), $template) : config("database.connections.{$template}");
|
||||
}
|
||||
|
||||
$template = config('tenancy.database.central_connection');
|
||||
return $this->getCentralConnection();
|
||||
}
|
||||
|
||||
return config("database.connections.{$template}");
|
||||
protected function getCentralConnection(): array
|
||||
{
|
||||
$centralConnectionName = config('tenancy.database.central_connection');
|
||||
|
||||
return config("database.connections.{$centralConnectionName}");
|
||||
}
|
||||
|
||||
public function getTenantHostConnectionName(): string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue