Skip to content

Conversation

@ilsyaa
Copy link

@ilsyaa ilsyaa commented Nov 18, 2025

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

✨ Added Wildcard Support to matchesRoute
This feature introduces wildcard (*) matching support to the matchesRoute method.

Developers can now use conventions like admin.users* to match multiple routes based on a common prefix, similar to wildcard matching in other frameworks like Laravel.

How it works:

  1. If the route identifier contains a *, it is treated as a regular expression pattern.
  2. The * is converted to .* (match zero or more characters).
  3. The dot character (.) is escaped to treat it as a literal dot (\\.).
  4. The regex is tested against route.name and route.pattern.

Example:

  • admin.users.* will match admin.users.index, admin.users.create, etc.
  • api.*.show will match api.posts.show, api.comments.show, etc.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@RomainLanz
Copy link
Member

RomainLanz commented Nov 18, 2025

Hey @ilsyaa! πŸ‘‹πŸ»

Thanks for the PR! πŸŽ‰

What would be the usecase for this feature?
Also, can you please add some tests to ensure your code is working and no regression is made in the future.

@ilsyaa
Copy link
Author

ilsyaa commented Nov 19, 2025

@thetutlage
Copy link
Member

Hello @ilsyaa

Sorry, if I wasn't clear. I meant we should support the route names and not the wildcard, because the regex based matching will have a mismatch between the actual route matching logic and this method.

@ilsyaa ilsyaa closed this by deleting the head repository Nov 20, 2025
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.

3 participants