Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/DomainList.php
Show All 28 Lines | class DomainList extends Command | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
if ($this->option('deleted')) { | if ($this->option('deleted')) { | ||||
$domains = Domain::withTrashed()->orderBy('namespace'); | $domains = Domain::withTrashed()->orderBy('namespace'); | ||||
} else { | } else { | ||||
$domains = Domain::orderBy('namespace'); | $domains = Domain::orderBy('namespace'); | ||||
} | } | ||||
$domains->withEnvTenant()->each( | $domains->withEnvTenantContext()->each( | ||||
function ($domain) { | function ($domain) { | ||||
$msg = $domain->namespace; | $msg = $domain->namespace; | ||||
if ($domain->deleted_at) { | if ($domain->deleted_at) { | ||||
$msg .= " (deleted at {$domain->deleted_at})"; | $msg .= " (deleted at {$domain->deleted_at})"; | ||||
} | } | ||||
$this->info($msg); | $this->info($msg); | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
} | } |