Feature/implement param pattern matching #1619
Merged
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.
For issue #1232
I spent a bit of time today looking at this, and it seems like there are very big deviations between Laravel's and Dingo's routing workflow. Whether this is by design or not... I really don't know. Anyway, I implemented this in a fairly simple way after some digging and digging, and it does seem to work for me, and passed a lot of unit tests in some large projects.
At the same time, the functionality is not 100% compatible with Laravel's Router - which checks each route individually, including this param pattern matching (until it finds the matching route), whereas this implementation does the same without param pattern matching, and then does that validation for the one found route at the end.
This could lead to inconsistent results if there are very ambiguous and routes defines (which is rather sloppy in any case).
Keen to have other people give this a try and give me feedback before I merge.