slots->hold($slot, $request->idempotencyKey()); // Повтор по ключу ничего не создал — отвечаем 200 вместо 201. $status = $hold->wasRecentlyCreated ? Response::HTTP_CREATED : Response::HTTP_OK; return HoldResource::make($hold)->response()->setStatusCode($status); } /** * POST /holds/{hold}/confirm */ public function confirm(int $hold): JsonResponse { return HoldResource::make($this->slots->confirm($hold))->response(); } /** * DELETE /holds/{hold} */ public function destroy(int $hold): JsonResponse { return HoldResource::make($this->slots->cancel($hold))->response(); } }