From 93ba9de599ca4ab79147aa172205035c5d9c9ae5 Mon Sep 17 00:00:00 2001 From: rinsvent Date: Sun, 17 May 2026 21:16:32 +0700 Subject: [PATCH] feat: add routes and bootstrap --- bootstrap/app.php | 6 +++++- routes/api.php | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 routes/api.php diff --git a/bootstrap/app.php b/bootstrap/app.php index c183276..f646504 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,5 +1,6 @@ withRouting( web: __DIR__.'/../routes/web.php', + api: __DIR__.'/../routes/api.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { - // + $middleware->alias([ + 'idempotency' => IdempotencyMiddleware::class + ]); }) ->withExceptions(function (Exceptions $exceptions): void { // diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 0000000..5ea0300 --- /dev/null +++ b/routes/api.php @@ -0,0 +1,13 @@ +middleware('idempotency'); + +Route::post('/holds/{id}/confirm', [HoldController::class, 'confirm']); +Route::delete('/holds/{id}', [HoldController::class, 'destroy']);