bug: dynamicPath cannot handle multiple directories with the same name
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
In the docs for routing we see:
If we call get() with no argument, the deepest matching dynamic part is returned. echo $dynamicPath->get();
however here is my example:
Here, we have groups with a slug, and event with a slug (I want to have another layer for repeating events which will be @occurrence.php hence the directory for event slug)
In any case, when I do $slug = $dynamicPath->get(); it returns the slug of the group. This contradicts the docs saying it will fetch the deepest matching dynamic part. Unless my understanding of deepest is wrong.
I can see why this happens, it just returns the first occurrence of the slug string that it finds, but how would I go about getting the slug of the event in this case?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the routing documentation around dynamicPath->get() and reproduce the nested group/event path containing duplicate slug directory names. Trace how dynamicPath selects a matching dynamic part and compare that behavior with the documented deepest match. Done means the event slug can be retrieved reliably in this example and the documentation accurately describes the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100