Added: language to User profile (DB)

The language were set only on session. But now it is
stored with user profile, on DB.

It is important as now I can send alert e-mails to each
user on their own languages and not the activer
user language.

Also, wherever the user logs out and logs in again,
it will see the same site locale.
This commit is contained in:
2018-10-02 23:53:35 -03:00
parent 82a8bcb7a2
commit 675200303a
8 changed files with 193 additions and 16 deletions

View File

@@ -15,11 +15,7 @@ Route::get('/', function () {
return view('welcome');
});
Route::get('/lang/{locale}', function ($locale) {
session(['lang' => $locale]);
session()->save();
return back();
});
Route::get('/lang/{locale}', 'LanguageController@update')->name('language');
Route::get('/product', 'ProductController@index')->middleware('verified');
Route::get('/product/{product}', 'ProductController@show')->middleware('verified');