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

ability to customize package routes #18

Merged
merged 9 commits into from
Jan 17, 2024
Merged

Conversation

pxpm
Copy link
Contributor

@pxpm pxpm commented Nov 23, 2023

We got a request to customize the package routes in #17

It was kind of expected since we use named routes that can't be overwritten by registering developer routes before the package ones.

A good practice in this cases is to have a configuration that allow the developers to disable package route registering and they register the routes themselves.

I've implemented that in this PR, but I went a little bit deeper on the real issue here.

I think the fact that you are in https://something.com/my-application/dasboard and you change the language in https://something.com/set-locale/pt instead of https://something.com/my-application/set-local/pt is a little bit weird.

I introduced a new configuration and tweaked the route a little bit, so that if developer enable use_backpack_route_prefix_on_admin_routes, if the current route has the admin prefix, we also add the admin prefix in the "set locale route".

Let me know what you think @promatik

@pxpm pxpm added the enhancement New feature or request label Nov 23, 2023
Copy link
Contributor

@promatik promatik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pxpm added small changes to comments and variable names 👌

I agree with these changes, I think @tabacitu should also agree/give his opinion 😶 Since he was unwilling to add the config file at the beginning, but I don't see a way around 🤷‍♂️

@promatik promatik assigned tabacitu and pxpm and unassigned promatik Nov 24, 2023
pxpm and others added 8 commits November 24, 2023 16:57
…etup-routes

# Conflicts:
#	resources/views/language-switcher.blade.php
#	routes/language-switcher.php
@pxpm pxpm merged commit 6773d5b into main Jan 17, 2024
3 checks passed
@pxpm pxpm deleted the add-option-to-dont-setup-routes branch January 17, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants