daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top