Open Naveedali1234 opened 4 years ago
php artisan route:trans:clear
@Naveedali1234 I am also trying the same. But no success. Any solution you found?
Same error
check your RouteServiceProvider if there are prfix assigned to your routes remove it .. if you added a prefix and need it .. move it to routes file itself .. 'prefix' => LaravelLocalization::setLocale() ... this prefix should be the first prefix
In case this will help anyone in the future, routes must not be cached so if you run php artisan route:cache or php artisan optimize locally or after deploying to the server, you will get the 404.
any solution?
Just follow the guide
https://github.com/mcamara/laravel-localization/blob/master/CACHING.md
i am trying to use mcamara package for language translation but on the root url i am getting 404 error. Actually i am trying to detect the ip address of the user and then set the locale according to that country. i stored the locales and country names in the database. Below is my code:
AppServiceProvider.php in this file i am fetching user ip address through https://github.com/stevebauman/location this package and checking the locale from database and set the locale according to that.
Web.php
Route::group([ 'prefix' => LaravelLocalization::getCurrentLocale(), 'middleware' => ['localizationRedirect', 'localeViewPath' ]], function(){ Route::get('/',function(){ dd('check'); }); }
i am getting 404 error on www.example.com but when i do www.example.com/en then it's working fine. Any Help would be really appreciated. i am stuck in it from few days.