localized description, built per-request for the view. */ private function channelDescriptions(): array { return [ 'stable' => __('system.channel_stable'), 'beta' => __('system.channel_beta'), ]; } /** Install-time panel domain (read-only display). */ public string $domain = ''; public string $channel = 'stable'; public function mount(DeploymentService $deployment): void { $this->domain = (string) ($deployment->domain() ?? ''); $channel = Setting::get('release_channel', config('clusev.channel')) ?? 'stable'; // Clamp to a valid user channel — a stale/legacy value (e.g. 'dev') falls back to stable. $this->channel = in_array($channel, self::CHANNELS, true) ? $channel : 'stable'; } /** Release channel changes are audited (confirmation via the shared modal). */ public function confirmChannel(string $channel): void { if (! in_array($channel, self::CHANNELS, true) || $channel === $this->channel) { return; } $this->dispatch('openModal', component: 'modals.confirm-action', arguments: [ 'heading' => __('system.change_channel_heading'), 'body' => __('system.change_channel_body', ['channel' => $channel]), 'confirmLabel' => __('system.change_channel_confirm'), 'danger' => false, 'icon' => 'git-branch', 'auditAction' => 'system.settings_updated', 'auditTarget' => 'release_channel='.$channel, 'event' => 'channelChanged', 'params' => ['channel' => $channel], 'notify' => __('system.change_channel_notify', ['channel' => $channel]), ], ); } #[On('channelChanged')] public function applyChannel(string $channel): void { if (! in_array($channel, self::CHANNELS, true)) { return; } Setting::put('release_channel', $channel); $this->channel = $channel; } public function render(DeploymentService $deployment) { return view('livewire.system.index', [ 'hasTls' => $this->domain !== '', 'panelUrl' => $deployment->panelUrl(), 'channels' => $this->channelDescriptions(), ])->title(__('system.title')); } }