<?php namespace App\Http\Middleware; use Illuminate\Support\Facades\Session; use Illuminate\Http\Request; use Closure; class checkLang { public function handle(Request $request, Closure $next) { $slocale = \Session::get('locale'); if( empty($slocale) ){ $cLocale = config('app.locale'); \App::setLocale($cLocale); } else { \App::setLocale($slocale); } return $next($request); } }