Schlüssel => Bezeichnung */ public function all(): array { return collect(config('updater.channels'))->map(fn (array $c) => $c['label'])->all(); } public function active(): string { try { $channel = $this->settings->get('updater.channel'); } catch (Throwable) { $channel = null; // Datenbank nicht erreichbar – Standardkanal. } return is_string($channel) && $this->exists($channel) ? $channel : config('updater.default_channel', 'stable'); } public function setActive(string $channel): void { $this->assertExists($channel); $this->settings->set('updater.channel', $channel); } public function client(?string $channel = null): UpdateClient { $channel ??= $this->active(); $this->assertExists($channel); return new UpdateClient($this->http, config("updater.channels.{$channel}.url")); } public function exists(string $channel): bool { return is_array(config("updater.channels.{$channel}")); } private function assertExists(string $channel): void { if (! $this->exists($channel)) { throw new InvalidArgumentException("Unbekannter Update-Kanal: {$channel}"); } } }