mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:04:03 +00:00
uuid -> id (references in code)
This commit is contained in:
parent
a7bb709bd4
commit
79f912384b
17 changed files with 46 additions and 45 deletions
|
|
@ -10,7 +10,7 @@ class CacheManager extends BaseCacheManager
|
|||
{
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
$tags = [config('tenancy.cache.tag_base') . tenant('uuid')];
|
||||
$tags = [config('tenancy.cache.tag_base') . tenant('id')];
|
||||
|
||||
if ($method === 'tags') {
|
||||
if (\count($parameters) !== 1) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class Install extends Command
|
|||
*/
|
||||
|
||||
Route::get('/', function () {
|
||||
return 'This is your multi-tenant application. The uuid of the current tenant is ' . tenant('uuid');
|
||||
return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id');
|
||||
});
|
||||
"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Migrate extends MigrateCommand
|
|||
}
|
||||
|
||||
tenant()->all($this->option('tenants'))->each(function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['uuid']} ({$tenant['domain']})");
|
||||
$this->line("Tenant: {$tenant['id']} ({$tenant['domain']})");
|
||||
|
||||
// See Illuminate\Database\Migrations\DatabaseMigrationRepository::getConnection.
|
||||
// Database connections are cached by Illuminate\Database\ConnectionResolver.
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class Rollback extends RollbackCommand
|
|||
$this->input->setOption('database', 'tenant');
|
||||
|
||||
tenant()->all($this->option('tenants'))->each(function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['uuid']} ({$tenant['domain']})");
|
||||
$this->line("Tenant: {$tenant['id']} ({$tenant['domain']})");
|
||||
$this->database->connectToTenant($tenant);
|
||||
|
||||
// Migrate
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class Run extends Command
|
|||
}
|
||||
|
||||
tenant()->all($this->option('tenants'))->each(function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['uuid']} ({$tenant['domain']})");
|
||||
$this->line("Tenant: {$tenant['id']} ({$tenant['domain']})");
|
||||
tenancy()->init($tenant['domain']);
|
||||
|
||||
$callback = function ($prefix = '') {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Seed extends SeedCommand
|
|||
$this->input->setOption('database', 'tenant');
|
||||
|
||||
tenant()->all($this->option('tenants'))->each(function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['uuid']} ({$tenant['domain']})");
|
||||
$this->line("Tenant: {$tenant['id']} ({$tenant['domain']})");
|
||||
$this->database->connectToTenant($tenant);
|
||||
|
||||
// Seed
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class TenantList extends Command
|
|||
{
|
||||
$this->info('Listing all tenants.');
|
||||
tenancy()->all()->each(function ($tenant) {
|
||||
$this->line("[Tenant] uuid: {$tenant['uuid']} @ {$tenant['domain']}");
|
||||
$this->line("[Tenant] id: {$tenant['id']} @ {$tenant['domain']}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
|
|||
return [];
|
||||
}
|
||||
|
||||
[$uuid, $domain] = tenant()->get(['uuid', 'domain']);
|
||||
[$id, $domain] = tenant()->get(['id', 'domain']);
|
||||
|
||||
return [
|
||||
'tenant_id' => $uuid,
|
||||
'tenant_id' => $id,
|
||||
'tags' => [
|
||||
"tenant:$uuid",
|
||||
"tenant:$id",
|
||||
"domain:$domain",
|
||||
],
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue