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'm currently writing a laravel application with a nested route parameter that is dependent on the previous route parameter. While reading the docs, I stumbled across the following paragraph:
When using a custom keyed implicit binding as a nested route parameter, Laravel will automatically scope the query to retrieve the nested model by its parent using conventions to guess the relationship name on the parent.
It's nice—no doubt about that—but nonetheless, odd. Why does this only happen with custom keys? That seems a bit arbitrary. I currently use "id" as a custom key to make use of that behavior. Is it possible to make use of it without that non-custom custom key AND without explicit binding?
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.
-
I'm currently writing a laravel application with a nested route parameter that is dependent on the previous route parameter. While reading the docs, I stumbled across the following paragraph:
It's nice—no doubt about that—but nonetheless, odd. Why does this only happen with custom keys? That seems a bit arbitrary. I currently use "id" as a custom key to make use of that behavior. Is it possible to make use of it without that non-custom custom key AND without explicit binding?
Beta Was this translation helpful? Give feedback.
All reactions