Skip to content

Commit

Permalink
If status code is 0 changes it to 500 to prevent error
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianzofcin committed Jan 20, 2023
1 parent 832c8c6 commit 1828a14
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Helpers/ApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1828a14

Please sign in to comment.