-
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
[8.x] Respect custom route key with explicit route model binding #36375
[8.x] Respect custom route key with explicit route model binding #36375
Conversation
Does this contain any (even minor) breaking changes? |
Breaking in the sense that someone relying on the old behaviour (because they assumed "that's just how it works"), will have their app broken. |
I left the order of parameters unchanged so it doesn't break your current routes. But like @GrahamCampbell said, if you rely on the broken behavior, then this will be a breaking change. |
Broken: #36443 Reverting. |
Hi there! 🚀
You can use explicit route model binding in a situation where implicit binding might not work. Implicit binding allows you to customize the binding field for each route.
Unfortunately, this doesn't work when you're using explicit binding. It always uses the
$model->getRouteKeyName()
.This PR makes sure that when explicitly binding models to route paramters, they respect any custom route fields being used.
Additionally, it passes the custom key to custom route binding.