Description
Laravel Version
10.16.0
PHP Version
8.1.19
Database Driver & Version
No response
Description
Symfony\Component\HttpFoundation\Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned
This error now occurs as soon as Laravel tries to handle any JSON request. This seems to be based on the new symfony/psr-http-message-bridge
v2.3.0 release.
But originally it seems like a far longer problem just never detected. With Symfony 6 types were added - so also to the Symfony\Component\HttpFoundation\Request::getPayload()
method. But for Laravel 9 the payload of JSON requests was filled into a ParameterBag
. All places not checking for explicit type won't have any problem as these classes have nearly identical APIs.
- Leverage
Request::getPayload()
to populate the parsed body of PSR-7 requests symfony/psr-http-message-bridge#117 framework/src/Illuminate/Http/Request.php
Lines 489 to 491 in 55ccc3a
- [9.x] Manually populate POST request body with JSON data only when required #37921
- https://github.com/symfony/symfony/blob/86c41bb42594e59bfec16df29e0829eb7e850431/src/Symfony/Component/HttpFoundation/Request.php#L1514
Steps To Reproduce
Send a JSON request to the server with "symfony/psr-http-message-bridge": "2.3.0"
installed.