Replies: 1 comment 2 replies
-
Is there anything preventing you from using middleware instead or is it just about a nicer syntax? Does this work well with compiled routes & route caching? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently encountered issue #31774 which talks about Laravels custom route validators not working for cached routes. In there is a comment by @driesvints pointing out that since Laravel uses Symfonys latest router these can't be honoured.
Symfony does support the adding of conditions, referred to as expressions to routes, allowing you to conditional match routes based on header values and the likes.
This uses Symfonys ExpressionLanguage so it could support that, or a nicer syntax, something like:
Could be useful for versioned APIs.
I think this is something that Laravel should implement, and I'd be happy to do so and make a PR. @driesvints recommended that I start a discussion in here and see what people think.
Is this something people would be interested in?
Beta Was this translation helpful? Give feedback.
All reactions