-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.3] Resource routes uri translations #16429
[5.3] Resource routes uri translations #16429
Conversation
091f647
to
e9cb492
Compare
This is indeed nice but using a method to define the translations look's so bad IMHO. I bet that we could come up with a better solution for this, IK why you did it this way though... |
@fernandobandeira I did it this way, because i don't want to over complicate things. If it were for me, i would never change urls, but there is clients that require the urls to be in french or whatever language they speak, and frankly i don't blame them. This is the simplest way i could think of and it's similar to how $parameterMap is handled, but i'm open for suggestions. |
I like this though not so much it's implementation (particularly the word
Also no way this can go into 5.3, it should be 5.4. |
@garygreen Yeah using |
Sure, not a breaking change but a feature like this shouldn't go as a patch version imo. Obvs up to Taylor anyway |
|
@shadoWalker89 @taylorotwell Does this still work in version L5.5? I'm not getting it to work, but version L5.4 work's. |
Sorry, I was putting the function in RouteServiceProvider instead of AppServiceProvider .. It's working .. |
The PR allows to define the slug for resource routes.
Now when a resource
foo
is added the uri forcreate
andedit
will befoo/ajouter
foo/{foo}/modifier
Why need this ?
When building applications for non english speakers, they always ask
why the urls are in english ?
, and in many cases they require them to be in the application language (which is french for me)So what i end up doing is using
resource()
for every thing exceptcreate
andedit
which i add manually.It become a pain and clutters the routes file.
This PR try to solve that by adding the possibility to customize the slugs used for create and edit routes