baseUrl = $baseUrl; $this->username = $username; $this->password = $password; return $this; } public function check(): bool { $response = $this->http()->get('/system/versions'); return 200 === $response->status(); } private function http(): PendingRequest { return Http::withBasicAuth($this->username, $this->password)->withOptions(['base_uri' => $this->baseUrl]); } }