add projet

This commit is contained in:
root
2026-03-05 12:29:37 -05:00
parent 8d1eef8ba8
commit 23b7db1107
9109 changed files with 1106501 additions and 73 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\Api;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\QueryException;
use Symfony\Component\HttpFoundation\Response;
class TestDBController extends BaseApiController
{
public function index()
{
try {
$result = DB::select('SELECT 1 AS ok');
if (!empty($result)) {
return $this->success(['message' => 'Database connection is successful.'], 'Database check completed');
}
return $this->respondError('Database connection failed', Response::HTTP_INTERNAL_SERVER_ERROR);
} catch (QueryException $e) {
return $this->respondError(
'Database connection failed: ' . $e->getMessage(),
Response::HTTP_INTERNAL_SERVER_ERROR
);
}
}
}