1
I have a language system in Arabic, I’m using their localization system. I have the system working, what happens and that when I return to the.com domain of the error I wanted there to show by default a language to define by me is possible ?
Route
Route::group(['prefix'=>'{lang}'], function (){
Route::get('/', function ($lang) {
App::setLocale($lang);
return view('home');
});
Route::get('/login', function ($lang) {
App::setLocale($lang);
return view('login');
});
Route::get('/registo', function ($lang) {
App::setLocale($lang);
return view('registo');
});
Route::get('/termos', function ($lang) {
App::setLocale($lang);
return view('termos');
});
Route::get('/sobre', function ($lang) {
App::setLocale($lang);
return view('sobre');
});
Route::get('/contactos', function ($lang) {
App::setLocale($lang);
return view('contactos');
});
});
Error
if you do.com domain it gives the error, because you did not pass lang as prefix ?
– novic
and give this one if I rule.com, as I resolve ?
– César Sousa
then, whether to store this lang in some Sesssion or cookie for this specific case. and test the input
Route::get('/', function ($lang) {
 if (!empy($lang)) App::setLocale($lang);
 return view('home');
 });
– novic
Sorry though your default route has a prefix that’s the problem
– novic