You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have models with slugs, those slugs have a history so we know all of the old slugs that were used, the only valid url is the current active slug though
So I was trying to build a redirector to detect when an old model slug is being used. So I hooked into the resolveRouteBinding of the model, but the problem is the parameter name is not being passed to that function. I thought it would be passed in the field parameter, but it's not
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context:
I have models with slugs, those slugs have a history so we know all of the old slugs that were used, the only valid url is the current active slug though
So I was trying to build a redirector to detect when an old model slug is being used. So I hooked into the
resolveRouteBindingof the model, but the problem is the parameter name is not being passed to that function. I thought it would be passed in the field parameter, but it's notSo right now the workaround seems to be to do a lookup on the old
$valueinstead of using$fieldlikeBut this is a bit of a hack and if there were multiple parameters with the same value it could be unreliable
I think passing the parameter name that it's trying to resolve to
resolveRouteBindingcan be a worthy additionBeta Was this translation helpful? Give feedback.
All reactions