Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to make resource routes scoped.
For a while, we have the ability to scope routes when using Implicit Route Model Binding. This is very useful because it provides a quick and easy route key customization and respects the parent-child relations as well:
This PR implements the same, but for resource routes, so if we wish to use the same functionality for a resource URL structure, we don't need to define the routes one-by-one to use this feature or writing a custom route binding resolution logic for each model.
Usage:
If we type hint our models in the controller methods using implicit route model binding, it will behave the same as the closure-based route above.
I don't think there is any breaking change so I chose the 7.x branch.
Also, if the PR is accepted, I'll open a PR for the docs as well.