Skip to content
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

[2.x] Use InputBag instead of ParameterBag #860

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

sy-records
Copy link
Contributor

Fix #859

symfony/http-foundation v7.0 added typed properties, so use attributes instead of request.

@driesvints driesvints changed the title Use attributes instead of request [2.x] Use attributes instead of request Mar 20, 2024
@driesvints
Copy link
Member

@sy-records Laravel v10 which Octane supports doesn't uses Symfony v7 components but v6 ones. Is this PR also compatible with that?

@sy-records
Copy link
Contributor Author

sy-records commented Mar 20, 2024

I'll test it.

Edit: I tested. It is compatible with 10.x(Symfony v6) and 11.x(Symfony v7). @driesvints

@driesvints
Copy link
Member

Thank you @sy-records

@taylorotwell
Copy link
Member

@sy-records would this not totally break retrieving input using Illuminate\Http\Request@input method?

@sy-records
Copy link
Contributor Author

@taylorotwell Tests using $request->attributes and $request->request have the same results.

@taylorotwell
Copy link
Member

taylorotwell commented Mar 21, 2024

Sorry, I mean in a real-world application, can you still use $request->input('foo') on a PATCH request in Octane after this change? If so, how? How does Laravel know how to access that data since it's now in attributes? Why not just set the request property to InputBag instead of changing it to use attributes?

@nunomaduro nunomaduro self-assigned this Mar 21, 2024
@nunomaduro nunomaduro marked this pull request as draft March 21, 2024 19:50
Use InputBag instead of ParameterBag
@sy-records sy-records changed the title [2.x] Use attributes instead of request [2.x] Use InputBag instead of ParameterBag Mar 22, 2024
@nunomaduro
Copy link
Member

Checking this...

@nunomaduro nunomaduro changed the base branch from 2.x to fix/swoole-requests March 22, 2024 14:58
@nunomaduro nunomaduro marked this pull request as ready for review March 22, 2024 14:58
@nunomaduro nunomaduro merged commit c250e30 into laravel:fix/swoole-requests Mar 22, 2024
12 checks passed
@sy-records sy-records deleted the fix/859 branch March 23, 2024 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error with Swoole on a PUT request with application/x-www-form-urlencoded content type
4 participants