laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.73k stars 289 forks source link

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

Closed sy-records closed 4 months ago

sy-records commented 4 months ago

Fix #859

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

driesvints commented 4 months ago

@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 commented 4 months ago

I'll test it.

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

driesvints commented 4 months ago

Thank you @sy-records

taylorotwell commented 4 months ago

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

sy-records commented 4 months ago

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

taylorotwell commented 4 months ago

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 commented 4 months ago

Checking this...