*/ class StatusCheckCommand extends Command { /** * A quick description of this command. * @return string. */ public function brief(): string { return 'Checks status for hosts set in config and saves results to the database.'; } /** * Command. */ public function execute(): void { $endpoints = config('status.check'); foreach ($endpoints as $name => $data) { [$host, $port, $proc] = explode('/', $data, 3); $this->getLogger()->writeln("Checking {$host} ($proc) on port {$port}..."); $status = new Status($host, $port, $proc); $status->check(); $status->save(); } } }