Route Aliases
#51306
Replies: 1 comment 3 replies
-
If a route can have an alias, does it really matter if it has one or multiple? |
Beta Was this translation helpful? Give feedback.
3 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.
-
TL;DR
Be able to set some alias for a named route.
Problem & Motivation
I have a Laravel project, I had to use two Laravel packages on that project. One was implementing some authentication logic
Package1
with some routes, let's say a route namedpackage.auth
. And the other packagePackage2
was for implementing some other logic with some UI that uses a pre-defined named routes, in this case let's saypackage.provider.auth
.Typically, I need to implement some routes to be able to use the second package, the problem is that, I wanted to use the routes from the
Package1
into the second package, I know that some approaches may be like defining a new route like this:But in my case, this will cause backward incompatibility.
I went through the Laravel documentation to check how to set a route alias to the
package.provider.auth
route and set it topackage.auth
, I couldn't find anything that allows me to add some alias name to a pre-defined named route. So, I wrote a PR to bring the functionality to Laravel routing system.Something like:
The mentioned PR is still needing a lot of work to be done, something like
route:list
artisan commandI just wanted to check some feedbacks from the community if the functionality is worth to be implemented, or it's a kind of over load for a custom situation - my described previous situation -.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions