Fix API reliability and CORS config for hosted deployment

This commit is contained in:
Abdul Kareem
2026-02-22 01:17:35 +03:00
parent cc11f2e063
commit 090427cf2c
20 changed files with 267 additions and 22 deletions
@@ -281,6 +281,8 @@ class ReservationController extends Controller
// CREATE RESERVATION (customer)
public function store(Request $request)
{
@set_time_limit(120);
$user = $request->user();
if ($user->isBlocked()) {
return response()->json(['message' => 'You are temporarily blocked from making reservations.'], 403);
@@ -319,7 +321,8 @@ class ReservationController extends Controller
'rejection_reason' => null,
]);
$table = $this->findAvailableTable($reservation, true, true);
// Avoid long lock waits in high-latency environments; use optimistic read.
$table = $this->findAvailableTable($reservation, true, false);
if (! $table) {
throw new \RuntimeException('No available table for this reservation.');
}