We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f17fb8c commit 517bd77Copy full SHA for 517bd77
src/Actions/GenerateCommentAction.php
@@ -34,7 +34,14 @@ public function __invoke(Request $request, bool $validate = true): JsonResponse
34
$startTime = microtime(true);
35
36
try {
37
- $payload = $request->isJson() ? $request->json()->all() : json_decode($request->getContent(), true);
+ if ($request->isJson()) {
38
+ $jsonContent = $request->json();
39
+ $payload = is_object($jsonContent) && method_exists($jsonContent, 'all')
40
+ ? $jsonContent->all()
41
+ : (array) $jsonContent;
42
+ } else {
43
+ $payload = json_decode($request->getContent(), true);
44
+ }
45
46
if (!empty($payload['payload'])) {
47
$payload = $payload['payload'];
0 commit comments