mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 17:04:03 +00:00
get down to 59 phpstan errors
This commit is contained in:
parent
193e044777
commit
a94227a19c
26 changed files with 130 additions and 130 deletions
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
|
||||
class TenantList extends Command
|
||||
|
|
@ -16,15 +17,16 @@ class TenantList extends Command
|
|||
public function handle(): void
|
||||
{
|
||||
$this->info('Listing all tenants.');
|
||||
tenancy()
|
||||
->query()
|
||||
->cursor()
|
||||
->each(function (Tenant $tenant) {
|
||||
if ($tenant->domains) {
|
||||
$this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? []));
|
||||
} else {
|
||||
$this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()}");
|
||||
}
|
||||
});
|
||||
|
||||
$tenants = tenancy()->query()->cursor();
|
||||
|
||||
foreach ($tenants as $tenant) {
|
||||
/** @var Model&Tenant $tenant */
|
||||
if ($tenant->domains) {
|
||||
$this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? []));
|
||||
} else {
|
||||
$this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue