Add support for release channels (insider release channel) in Updater

This commit is contained in:
Darko Gjorgjijoski
2024-08-04 03:04:10 +02:00
parent bcb89bc9ae
commit 9a46f892ab
5 changed files with 39 additions and 16 deletions

View File

@@ -10,14 +10,21 @@ class AppVersionController extends Controller
/**
* Handle the incoming request.
*
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke(Request $request)
{
$version = Setting::getSetting('version');
$channel = Setting::getSetting('updater_channel');
if (is_null($channel)) {
$channel = 'stable';
Setting::setSetting('updater_channel', 'stable'); // default.
}
return response()->json([
'version' => $version,
'channel' => $channel,
]);
}
}