-
Notifications
You must be signed in to change notification settings - Fork 73
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
how to set patterns for wildcards in annotations? #59
Comments
managed to the get patterns so I know they're not being ignored, but would still like to know if I can set a pattern via annotation |
Im not sure if this is possible. Ill dig into it soon. |
I managed to get it working like this after #83:
Tested like this:
But the where parameter should work like this even before the patch:
|
@alexfoo thanks a lot for your reply! Would you happen to know how I can set it so that it would match anything except a short list of reserved words? Meaning, I have this route annotation
And I want this route to match every word, alpha or numeric or whatever, except for a small list of these reserved routes: nova, telescope, horizon, log-viewer I'm really bad a regex and can't seem to figure this one out |
Figured it out!
|
I'm using many wildcards and getting some mismatching which would be solved if patterns were respected
for example I have these two routes
/{any}/{page}
and
/{any}/{name}
going to /something/12 should hit the first route
and going to /something/name should hit the 2nd route
regardless of what order they are defined in
I tried adding
Route::pattern('page', '[0-9]+');
to the RouteServiceProvider
which is supposed to enforce that the {page} argument must always be fully numerical in order for that route to be matched.. but it's not working
Do you know if using annotations for my routes with this package is ignoring patterns set in the RouteServiceProvider?
And is there a way then to set regex patterns for wildcard routes directly in the annotations?
Or another solution?
Many thanks!
The text was updated successfully, but these errors were encountered: