Skip to content

Commit

Permalink
fix(util): Fix JsendFormatter error data type
Browse files Browse the repository at this point in the history
  • Loading branch information
falkia34 committed Aug 13, 2024
1 parent 6bd9729 commit 68a4f00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Utils/JsendFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function error(string $message, ?string $code = null, ?array $data
'message' => $message,
];
! is_null($code) && $response['code'] = $code;
$response['data'] = array_merge(['message' => $message], $data);
$response['data'] = array_merge(['message' => $message], $data ?? []);

return response()->json($response, $status, $extraHeaders);
}
Expand Down

0 comments on commit 68a4f00

Please sign in to comment.