Files
lotteryLaravel/app/Http/Controllers/Api/V1/HealthController.php

28 lines
631 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Support\ApiResponse;
use Illuminate\Http\JsonResponse;
class HealthController extends Controller
{
/**
* 健康检查Next / 网关探活。路径GET /api/v1/health
*/
public function __invoke(): JsonResponse
{
$payload = [
'app' => config('app.name'),
'default_currency' => config('lottery.default_currency'),
];
if (config('app.debug')) {
$payload['laravel'] = app()->version();
}
return ApiResponse::success($payload);
}
}