chinleung/laravel-multilingual-routes

Issue with / when the site is under a subdirectory

kyfr59 opened this issue · 1 comments

Hi Chin and thanks for your great work.

I've an issue with the / route when the site is under a subdirectory, e.g. :

http://local/mysite/

I've 2 locales ['en', 'fr'] and my base is "fr".

All my routes can switch between my locales, except the homepage, on http://local/mysite (in french) :

  • current_route("en") gives me : http://local/mysite/mysite, probably due to this line (my REQUEST_URI is mysite)

  • When I enter manually http://local/mysite/en, I've a 404 error.

Any idea to solve the problem ?

Thanks.

Franck.

Route::multilingual('/', function () { instead of Route::get('/', function () { solve the issue 🥇

Sorry for the buzz.

Franck.