1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00

Use tenant key on console commands instead of id (#768)

This commit is contained in:
sort72 2021-12-25 09:24:34 -05:00 committed by GitHub
parent 2726f07bca
commit 08bfd6f9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View file

@ -55,7 +55,7 @@ class Migrate extends MigrateCommand
}
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}");
$this->line("Tenant: {$tenant->getTenantKey()}");
event(new MigratingDatabase($tenant));

View file

@ -53,7 +53,7 @@ class Rollback extends RollbackCommand
}
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}");
$this->line("Tenant: {$tenant->getTenantKey()}");
event(new RollingBackDatabase($tenant));

View file

@ -33,7 +33,7 @@ class Run extends Command
public function handle()
{
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}");
$this->line("Tenant: {$tenant->getTenantKey()}");
tenancy()->initialize($tenant);
$callback = function ($prefix = '') {

View file

@ -51,7 +51,7 @@ class Seed extends SeedCommand
}
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}");
$this->line("Tenant: {$tenant->getTenantKey()}");
event(new SeedingDatabase($tenant));

View file

@ -36,9 +36,9 @@ class TenantList extends Command
->cursor()
->each(function (Tenant $tenant) {
if ($tenant->domains) {
$this->line("[Tenant] id: {$tenant['id']} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? []));
$this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? []));
} else {
$this->line("[Tenant] id: {$tenant['id']}");
$this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()}");
}
});
}