Created
March 26, 2020 19:56
-
-
Save morloderex/1fcb7cb7473b09a2698fe86bcad1be8e to your computer and use it in GitHub Desktop.
Poposal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createTenantConnection(Tenant $tenant) | |
{ | |
$tenantManager = $this->getTenantManager($tenant); | |
// Create the database connection. | |
$based_on = $this->getBaseConnection($connectionName); | |
$currentConfig = $this->app['config']['database.connections.' . $based_on]; | |
$mergedConfig = array_replace($currentConfig, $tenantManager->createTenantConnection($tenant, $currentConfig) ?? []); | |
$this->app['config']['database.connection.' . $tenant->getConnectionName()] = $mergedConfig; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment