Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/DomainStatus.php
Show All 38 Lines | class DomainStatus extends Command | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$domain = Domain::where('namespace', $this->argument('domain'))->first(); | $domain = Domain::where('namespace', $this->argument('domain'))->first(); | ||||
if (!$domain) { | if (!$domain) { | ||||
return 1; | return 1; | ||||
} | } | ||||
$this->info($domain->status); | $statuses = [ | ||||
'active' => Domain::STATUS_ACTIVE, | |||||
'suspended' => Domain::STATUS_SUSPENDED, | |||||
'deleted' => Domain::STATUS_DELETED, | |||||
'ldapReady' => Domain::STATUS_LDAP_READY, | |||||
'verified' => Domain::STATUS_VERIFIED, | |||||
'confirmed' => Domain::STATUS_CONFIRMED, | |||||
]; | |||||
foreach ($statuses as $text => $bit) { | |||||
$func = 'is' . \ucfirst($text); | |||||
$this->info(sprintf("%d %s: %s", $bit, $text, $domain->$func())); | |||||
} | |||||
$this->info("In total: {$domain->status}"); | |||||
} | } | ||||
} | } |