Guest User

Untitled

a guest
Feb 13th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Route::group(['prefix' => '{lang?}'], function () {
  2. //..
  3. });
  4.  
  5. public function handle($request, Closure $next){
  6.  
  7. $lang = session('locale');
  8.  
  9. return $next($request);
  10. });
  11.  
  12. Route::group(['prefix' => config('app.locale')], function () {
  13. //..
  14. });
  15.  
  16. Route::group(['prefix' => session('locale')], function () {
  17. //..
  18. });
  19.  
  20. Route::get('setlocale/{locale}', function ($locale) {
  21.  
  22. session(['locale' => $locale]);
  23.  
  24. return redirect()->back();
  25.  
  26. })->name('setlocale');
Add Comment
Please, Sign In to add comment