Skip to content

how to set patterns for wildcards in annotations? #59

@vesper8

Description

@vesper8

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions