complete story 1.3 with qa test (please not that the previous commit msg was wrong the previous commit was story 1.2
This commit is contained in:
@@ -8,6 +8,20 @@ Route::get('/', function () {
|
||||
return view('welcome');
|
||||
})->name('home');
|
||||
|
||||
Route::get('/language/{locale}', function (string $locale) {
|
||||
if (! in_array($locale, ['ar', 'en'])) {
|
||||
abort(400);
|
||||
}
|
||||
|
||||
session(['locale' => $locale]);
|
||||
|
||||
if (auth()->check()) {
|
||||
auth()->user()->update(['preferred_language' => $locale]);
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
})->name('language.switch');
|
||||
|
||||
Route::middleware(['auth', 'active'])->group(function () {
|
||||
// Admin routes
|
||||
Route::middleware('admin')->prefix('admin')->group(function () {
|
||||
|
||||
Reference in New Issue
Block a user