tethys/app/Http/Middleware/Locale.php
Arno Kaimbacher 8d91d0e7a8 langswitch
2020-06-10 21:09:13 +02:00

34 lines
691 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
use Session;
use App;
use Config;
class Locale
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
// if(!Session::has('locale'))
// {
// Session::put('locale', Config::get('app.locale'));
// }
$language = Session::get('locale', Config::get('app.locale'));
// $data = Session::all();
// $language =Session::get('locale1');
App::setLocale($language);
return $next($request);
}
}