Skip to content

Commit

Permalink
fix: use capture to populate global request with json array (#883)
Browse files Browse the repository at this point in the history
Request::capture is using createFromBase that checks is request is json and replace request with json array

``` 
       if ($newRequest->isJson()) {
            $newRequest->request = $newRequest->json();
        } 
```

and later when in controller you can use request->get('some-json-key') to get value as its a default laravel behavior [check index.php:53]
  • Loading branch information
krowinski authored May 7, 2024
1 parent 93c0e04 commit 61a3e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FrankenPhp/FrankenPhpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FrankenPhpClient implements Client
public function marshalRequest(RequestContext $context): array
{
return [
Request::createFromGlobals(),
Request::capture(),
$context,
];
}
Expand Down

0 comments on commit 61a3e69

Please sign in to comment.