Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple nested routes #36

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

ricventu
Copy link
Contributor

Hi
In case of multiple child controller, add the parent to each children
For example:

PhotosController.php
Photos/CommentsController.php
Photos/UsersController.php

the routes are:

photos/{photo}
photos/edit/{photo}
photos/{photo}/users/{user}
photos/{photo}/users/edit/{user}
photos/{photo}/comments/{comment}
photos/{photo}/comments/edit/{comment}

This fixes #35 issue

@freekmurze
Copy link
Member

Nice! Could you also take care of the PHPStan errors?

@ricventu
Copy link
Contributor Author

I have fixed the PHPStan errors for this PR. If you'd like, I can create a separate PR to address the remaining errors as well.

@freekmurze
Copy link
Member

I have fixed the PHPStan errors for this PR. If you'd like, I can create a separate PR to address the remaining errors as well.

Please do so, thanks! I'll already merge this in! 👍

@freekmurze freekmurze merged commit 2b2c500 into spatie:main Jan 22, 2025
18 of 19 checks passed
@ricventu ricventu deleted the handle-multiple-nested-controller branch January 22, 2025 16:20
@ricventu
Copy link
Contributor Author

Hi!
Could you please create a release with this Pull Request?

Thanks

@freekmurze
Copy link
Member

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing route parent path in case of multiple children
2 participants