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']);