Skip to content
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

Automatically exclude POST and other methods except GET from middlewares #760

Closed
baltun opened this issue Nov 16, 2020 · 3 comments
Closed

Comments

@baltun
Copy link
Contributor

baltun commented Nov 16, 2020

I don't want to do any changes with my POST, PUT, PATCH and DELETE routes:

  • don't want to put them outside of the group because they grouped with GET routes logically
  • don't want to use route() everywhere instead of url, because there are a lot of these places in working project
  • don't want to make a lot of same groups for locations for each GET route

And translation works only with GET routes because only this type of routes shows data for translation

So is it possible to automatically exclude any other than GET method urls from middlewares to not do anything with these kinds of urls?

@baltun baltun changed the title Automatically exclude POST and other methods from middleware Automatically exclude POST and other methods except GET from middlewares Nov 16, 2020
@baltun
Copy link
Contributor Author

baltun commented Nov 16, 2020

By the way it could be configured in config like "laravellocalization.urlsIgnored", it could be something like "laravellocalization.httpMethodsIgnored" or "laravellocalization.httpMethodsLocalized"

@baltun
Copy link
Contributor Author

baltun commented Nov 17, 2020

I've created a PR with this functionality, please accept

mcamara pushed a commit that referenced this issue Oct 24, 2021
…g' issue (#762)

Co-authored-by: Ilya Kolesnikov <ivkol@mail.ru>
@iwasherefirst2
Copy link
Collaborator

Your PR has been merged.

Nuranto pushed a commit to Nuranto/laravel-localization that referenced this issue Jan 14, 2022
… working' issue (mcamara#762)

Co-authored-by: Ilya Kolesnikov <ivkol@mail.ru>
(cherry picked from commit c71bb11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants