Antwort von /license (zusätzlich gespeichert) * * @throws ServerError */ public function check(): array { try { $info = $this->channels->client()->license(); $this->store->rememberStatus($info); return $info; } catch (ServerError $e) { Log::notice("Lizenzprüfung: {$e->errorCode}"); $this->store->rememberStatus(null, $e->errorCode); throw $e; } } /** * Gibt den Geräteplatz dieser Installation frei. * * @throws ServerError */ public function releaseDevice(): void { $response = VendorHttp::guard(fn () => $this->http->request((int) config('updater.timeouts.json'), identifyDevice: false) ->post(rtrim(config('updater.api_url'), '/').'/license/release-device?software='.config('updater.software'))); if (! $response->successful()) { throw VendorHttp::errorFrom($response); } } /** * Aufbereitete Lizenzdaten für die Anzeige (aus der letzten Prüfung). * * @return array|null */ public function summary(): ?array { $info = $this->store->lastStatus()['info'] ?? null; if (! is_array($info)) { return null; } $license = $info['license'] ?? []; $unlimited = (bool) ($license['unlimited'] ?? false); $days = $license['days_remaining'] ?? null; return [ 'status' => $license['status'] ?? null, // valid_until = null zusammen mit unlimited = true heißt UNBEFRISTET – kein Fehler. 'unlimited' => $unlimited, 'valid_until' => $license['valid_until'] ?? null, 'days_remaining' => is_numeric($days) ? (int) $days : null, 'expired' => ! $unlimited && (bool) ($license['expired'] ?? false), 'expires_soon' => ! $unlimited && is_numeric($days) && (int) $days >= 0 && (int) $days < 30, 'registered_to' => $info['registered_to'] ?? [], 'devices' => $info['devices'] ?? [], ]; } }