json([ 'version' => preg_replace('~[\r\n]+~', '', File::get(base_path('version.md'))), 'channel' => $this->releaseChannel(), 'containerized' => (bool) config('invoiceshelf.containerized'), ]); } /** * The stored channel, self-healing: the first caller to find nothing stored * gets "stable" and leaves that default behind for everyone after them. */ private function releaseChannel(): mixed { $stored = Setting::getSetting('updater_channel'); if (! is_null($stored)) { return $stored; } Setting::setSetting('updater_channel', 'stable'); return 'stable'; } }