shareit/app/Http/Middleware/Locale.php

22 lines
368 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
class Locale
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
\App::setLocale(session('lang'));
return $next($request);
}
}