Load route models with relations via attribute #53770
Unanswered
kylemilloy
asked this question in
Ideas
Replies: 2 comments 4 replies
-
This might be something you are looking for: https://laravel.com/docs/11.x/routing#explicit-binding In the callback you could check for the current route to be the one you want to use it for. |
Beta Was this translation helpful? Give feedback.
4 replies
-
Might be something to add to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I dunno if this is possible and haven't really dug into it but was just thinking it'd be nice to be able to load relations with route model binding without having to do the extra steps of getting the ID, giving a "with" and then loading it inside the controller body. I find sometimes I have relations that I don't always want to include but then for specific pages I need to bind them.
So like instead of:
Or with two trips...
I can do it in the function args.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions