How to expand route syntax or hook into route creation process? #46601
Unanswered
faustbrian
asked this question in
Q&A
Replies: 0 comments
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.
-
So I've been wondering if it is possible to expand the router without macros by swapping it out. Specifically the route creation, which happens in
Illuminate\Routing\Router::createRoute
. My use-case would be the to expand the route syntax without relying on macros because the expanded syntax should just work for every HTTP verb without having to use custom functions, so a customcreateRoute
implementation would be the simplest.Dug around the source a bit and the router seems to be the only part that has hardcoded calls to
Illuminate\Routing\Router
and various other classes in that namespace rather than an interface and swapping therouter
binding in the container results in all kinds of funky issues.Is there currently any way to hook into the
createRoute
call or use a custom router? What would be the recommended approaches to hook into the route creation process or is this not possible at all with the current architecture, besides macros?Beta Was this translation helpful? Give feedback.
All reactions