DatabaseConfig
class DatabaseConfig (View source)
Properties
TenantWithDatabase&Model | $tenant | The tenant whose database we're dealing with. |
|
static Closure|null | $usernameGenerator | Database username generator (can be set by the developer.) |
|
static Closure|null | $passwordGenerator | Database password generator (can be set by the developer.) |
|
static Closure|null | $databaseNameGenerator | Database name generator (can be set by the developer.) |
Methods
No description
No description
No description
No description
Generate DB name, username & password and write them to the tenant model.
No description
No description
No description
No description
Tenant's own database connection config.
Tenant's host database connection config.
Purge host database connection.
Additional config for the database connection, specific to this tenant.
Get the TenantDatabaseManager for this tenant's connection.
todo come up with a better name Get database manager class from the given connection config's driver.
Details
static void
__constructStatic()
No description
__construct(Model&TenantWithDatabase $tenant)
No description
static void
generateDatabaseNamesUsing(Closure $databaseNameGenerator)
No description
static void
generateUsernamesUsing(Closure $usernameGenerator)
No description
static void
generatePasswordsUsing(Closure $passwordGenerator)
No description
string
getName()
No description
string|null
getUsername()
No description
string|null
getPassword()
No description
void
makeCredentials()
Generate DB name, username & password and write them to the tenant model.
string
getTemplateConnectionDriver()
No description
array
getTemplateConnection()
No description
protected array
getCentralConnection()
No description
string
getTenantHostConnectionName()
No description
array
connection()
Tenant's own database connection config.
array
hostConnection()
Tenant's host database connection config.
void
purgeHostConnection()
Purge host database connection.
It's possible database has previous tenant connection. This will clean up the previous connection before creating it for the current tenant.
array
tenantConfig()
Additional config for the database connection, specific to this tenant.
TenantDatabaseManager
manager()
Get the TenantDatabaseManager for this tenant's connection.
protected TenantDatabaseManager
connectionDriverManager(string $driver)
todo come up with a better name Get database manager class from the given connection config's driver.