mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 11:54:04 +00:00
comment grammar
This commit is contained in:
parent
1ae7d58fab
commit
0fdc59dc5d
1 changed files with 2 additions and 2 deletions
|
|
@ -92,14 +92,14 @@ class DatabaseTenancyBootstrapper implements TenancyBootstrapper
|
||||||
/** @var \Stancl\Tenancy\Database\Models\Tenant&TenantWithDatabase $tenant */
|
/** @var \Stancl\Tenancy\Database\Models\Tenant&TenantWithDatabase $tenant */
|
||||||
$tenantDbName = $tenant->database()->getName();
|
$tenantDbName = $tenant->database()->getName();
|
||||||
|
|
||||||
// Check if any other tenant uses this tenant's database
|
// Check that no other tenant uses this tenant's database
|
||||||
if ($tenant::where($tenant->getTenantKeyName(), '!=', $tenant->getTenantKey())
|
if ($tenant::where($tenant->getTenantKeyName(), '!=', $tenant->getTenantKey())
|
||||||
->where($tenant::getDataColumn() . '->' . $tenant->internalPrefix() . 'db_name', $tenantDbName)
|
->where($tenant::getDataColumn() . '->' . $tenant->internalPrefix() . 'db_name', $tenantDbName)
|
||||||
->exists()) {
|
->exists()) {
|
||||||
throw new RuntimeException('Tenant cannot use a database of another tenant.');
|
throw new RuntimeException('Tenant cannot use a database of another tenant.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the current database is not the central database
|
// Check that the current database is not the central database
|
||||||
$centralDbName = DB::connection(
|
$centralDbName = DB::connection(
|
||||||
config('tenancy.database.central_connection', 'central')
|
config('tenancy.database.central_connection', 'central')
|
||||||
)->getDatabaseName();
|
)->getDatabaseName();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue