From 1828a147747687d994639e3e9637bba65f28f5ea Mon Sep 17 00:00:00 2001 From: adrianzofcin Date: Fri, 20 Jan 2023 13:44:25 +0100 Subject: [PATCH] If status code is 0 changes it to 500 to prevent error --- src/Helpers/ApiResponse.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Helpers/ApiResponse.php b/src/Helpers/ApiResponse.php index 932dfbe..d892611 100644 --- a/src/Helpers/ApiResponse.php +++ b/src/Helpers/ApiResponse.php @@ -105,6 +105,7 @@ public static function message(string $message): static */ public static function response(int $statusCode = 200): \Illuminate\Http\JsonResponse { + if ($statusCode === 0) $statusCode = 500; $message = null; if (self::$message) $message = self::$message; else $message = self::$code ? __(self::$codePrefix .'.' . self::$code) : null;