Ability to resolve route models from the form request #38432
Replies: 4 comments
-
Agree, there are times that we also want to control the model binding for specific request. |
Beta Was this translation helpful? Give feedback.
-
it's nice and clean! it can also reduce redundant duplicated queries done afterwards in the controller. |
Beta Was this translation helpful? Give feedback.
-
I use similar feature but method resolvePost moved to model. |
Beta Was this translation helpful? Give feedback.
-
If the model is resolved with route model binding, simply using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It happened many times that in my company we wanted to use route model bindings but didn't have the option to control it easily. Customizing the resolution logic in the service provider is fine for cases you re-use the model, but it doesn't happen a lot, and it gives more control, less coupling, and better readability to have the resolution within the form request.
So in my company we prefer doing this today (as a workaround):
It could be better to have this supported:
Beta Was this translation helpful? Give feedback.
All reactions