diff --git a/src/Controllers/ApiController.php b/src/Controllers/ApiController.php index c1125bc..6e73e00 100644 --- a/src/Controllers/ApiController.php +++ b/src/Controllers/ApiController.php @@ -126,6 +126,21 @@ public function responseNoContent( return $this->setResponseCode(204) ->respond(['message' => $message], $headers); } + + /** + * @param string $message + * @param array $headers + * @return JsonResponse + */ + public function responseAccepted( + string $message = 'The request was accepted for processing', + array $headers = [] + ): JsonResponse { + + return $this->setResponseCode(202) + ->setStatusCode(224) + ->respond(['message' => $message], $headers); + } /** * @param array $headers