1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-06-21 11:54:04 +00:00

comment grammar

This commit is contained in:
Samuel Stancl 2026-06-09 16:10:47 -07:00
parent 1ae7d58fab
commit 0fdc59dc5d
No known key found for this signature in database
GPG key ID: BA146259A1E16C57

View file

@ -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();