-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request Merge Problem #47877
Comments
What kind of value are you attempting to merge in? We had to make changes to the request input due to type changes in Symfony and they have classes marked as final so we have no way to work around it. |
I experience similar issue in laravel v9.52.12 / php v8.1.21. Also json endpoint. |
I have two string input parameters. I concatenate these two strings into a variable, and then I try to merge that variable into the request. It used to work without any issues in older versions, but in the current version, I'm unable to add the concatenated variable to the request. I want to clarify that I'm using middleware for this code block: $request->merge(['fullname' => concat($request->get('name') ?? "", $request->get('lastname') ?? "")]); Both 'name' and 'lastname' are expected to be in string format in the JSON request. |
Yes same problem for me as well . @taylorotwell @kursadaltanmed
|
I would stop using |
I've created a potential PR to fix this issue: #47914 I'll close this and we can track the issue in the PR. |
Laravel Version
9.52.12
PHP Version
8.0.2
Database Driver & Version
Mysql
Description
The request merge function we use in Middleware does not work in this version. It does not merge into the request.
9.52.11 version don't have this problem.
Steps To Reproduce
Ex:
SomeMiddleware
$request->merge(['fullname' => concate($request->get('name') ?? "", $request->get('lastname') ?? "")]);
Body
Content Type : Json
{
"name" : "Test",
"lastname" : "Test",
}
The text was updated successfully, but these errors were encountered: