vendredi 27 avril 2018

Laravel 5.6 Routing - Force language in the URL

I am creating a multilingual app with Laravel 5.6.

I want to force anything the URL to specifically use the language parameter.

e.g

www.myapps.com/something/somethingelse/andmore...

would redirect to

www.myapps.com/**en**/something/somethingelse/andmore...

So far,

I have used :

  Route::prefix('{lang}')->group(function () {
    Route::get('/', 'HomeController@index')->name('welcome');
    Route::get('/XYZ', 'HomeController@XXXXFunction')->name('another');
  }); 

But how do I force a redirect to a the language?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HAevFv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire