framework: request()->merge(...) does not work any more after `v9.36.4` update
- Laravel Version: 9.36.4
- PHP Version: 8.1.11
- Database Driver & Version: MySQL 8.1
Description:
After update to 9.36.4 request()->merge(...)
stopped working and does not replace the input.
Steps To Reproduce:
Use the request()->merge(['a' => 'c'])
on the json request which has {"a": "b"}
in the request body.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (11 by maintainers)
@rodrigopedra
Was able to reproduce the described issue. Please take a look at this pull request: https://github.com/rodrigopedra/laravel-issue-44687/pull/1
@buglinjo I did the change you suggested and I still can’t reproduce…
I uploaded a repository, so you can double check:
https://github.com/rodrigopedra/laravel-issue-44687
I even used
composer bump
to ensure Laravel is in 9.36.4 version@rodrigopedra thanks a lot for your help.
Unfortunately your solution doesn’t work also (
@buglinjo I agree with you in that matter, so I sent the PR I talk about in the comment linked above.
But sometimes we have to deal with how things are… Good luck and sorry for not finding a solution. Have a nice day =)
The same issue also.
@buglinjo
one more thing: if you find anything that should be changed, it is easier if you send a PR to the repository.
Also, I checked two of my own projects where I use
$request->merge()
after a form request’s validation to replace, for example, dates with carbon instances into the request, and they are working as expected with Laravel latest version.