21 lines
481 B
PHP
21 lines
481 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Setting;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class VersionController extends Controller
|
|
{
|
|
public function __invoke(): JsonResponse
|
|
{
|
|
$version = Setting::where('key', 'version')->value('value');
|
|
$build = Setting::where('key', 'build')->value('value');
|
|
|
|
return response()->json([
|
|
'version' => $version,
|
|
'build' => $build !== null ? (int) $build : null,
|
|
]);
|
|
}
|
|
}
|