chinleung / laravel-multilingual-routes

A package to handle multilingual routes in your Laravel application.
https://github.com/chinleung/laravel-multilingual-routes-demo
MIT License
394 stars 26 forks source link

Redirections #49

Closed chinleung closed 2 years ago

chinleung commented 3 years ago

Add support for multilingual redirections.

Route::multilingual('contact')->redirect('support', 302);

To generate the following routes:

+------------------+--------------+---------------------------------------+
| URI              | Name         | Action                                |
+------------------+--------------+---------------------------------------+
| contact          | en.contact   | Illuminate\Routing\RedirectController |
| fr/nous-joindre  | fr.contact   | Illuminate\Routing\RedirectController |
+------------------+--------------+---------------------------------------+
AbdullahFaqeir commented 2 years ago

@chinleung can you please elaborate?

chinleung commented 2 years ago

@chinleung can you please elaborate?

@AbdullahFaqeir

Basically it will handle the redirections of a route in all locales. As of now, if you want to redirect a route, you'd have to manually add it like this in all locales:

Route::redirect('contact', 'support');
Route::redirect('fr/nous-joindre', 'fr/support');

So adding a redirect method would handle that.

AbdullahFaqeir commented 2 years ago

@chinleung

This issue to be closed.

chinleung commented 2 years ago

This is supported as of v2.8.0.