codezero-be / laravel-localized-routes

⭐️ A convenient way to set up and use localized routes in a Laravel app.
MIT License
491 stars 45 forks source link

Disable prefix for route names #110

Closed Twyar closed 4 months ago

Twyar commented 4 months ago

From the README:

With supported locales ['en', 'nl'], the above would register:

URI | Name -- | -- /en/about | en.about /nl/about | nl.about

Is it somehow possible to disable this and have the routes called the same name ?

In an older Laravel 10 project I am using https://github.com/mcamara/laravel-localization and this doesn't prefix all the route names with the local names. This makes it easier for me to use in the front-end using ziggy. (Using Laravel with Inertia and Vue3).

In my old project

route('about')

Would redirect to the about page of the current selected locale.

Now that it's split up by using this page in the 2 routes states above, what's the best way I can do to achieve the same thing ?