Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::group(['prefix' => '{lang?}'], function () {
- //..
- });
- public function handle($request, Closure $next){
- $lang = session('locale');
- return $next($request);
- });
- Route::group(['prefix' => config('app.locale')], function () {
- //..
- });
- Route::group(['prefix' => session('locale')], function () {
- //..
- });
- Route::get('setlocale/{locale}', function ($locale) {
- session(['locale' => $locale]);
- return redirect()->back();
- })->name('setlocale');
Add Comment
Please, Sign In to add comment