remove codeigniter
This commit is contained in:
@@ -7,7 +7,7 @@ use Illuminate\Http\JsonResponse;
|
||||
|
||||
class AccessDeniedController extends Controller
|
||||
{
|
||||
/** CI route: GET /access_denied */
|
||||
/** legacy route: GET /access_denied */
|
||||
public function accessDenied(): JsonResponse
|
||||
{
|
||||
return response()->json([
|
||||
|
||||
@@ -19,7 +19,7 @@ class HealthController extends BaseApiController
|
||||
$payload = $this->service->check();
|
||||
$status = $payload['ok'] ? Response::HTTP_OK : Response::HTTP_SERVICE_UNAVAILABLE;
|
||||
|
||||
// CodeIgniter admin/API health returns a flat JSON body (no Laravel success envelope).
|
||||
// legacy admin/API health returns a flat JSON body (no Laravel success envelope).
|
||||
return response()->json($payload, $status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,25 +4,18 @@ namespace App\Http\Controllers\Api\System;
|
||||
|
||||
use App\Http\Controllers\Api\Core\BaseApiController;
|
||||
use App\Models\Stats;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class StatsController extends BaseApiController
|
||||
{
|
||||
protected Stats $stats;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->stats = model(Stats::class);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
$stats = $this->stats->findAll();
|
||||
$stats = Stats::query()->get()->toArray();
|
||||
return $this->success($stats, 'Statistics retrieved successfully');
|
||||
} catch (\Throwable $e) {
|
||||
log_message('error', 'Stats retrieval error: ' . $e->getMessage());
|
||||
Log::error('Stats retrieval error: '.$e->getMessage());
|
||||
return $this->respondError('Failed to retrieve statistics', Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user