1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00
2022-03-02 12:19:52 +01:00

27 lines
504 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use App\LaravelGettext\Facades\LaravelGettext;
class Language
{
/**
* Handle an incoming request.
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
$manager = LaravelGettext::getFacadeRoot();
$locale = env('APP_LOCALE', 'it_IT');
$manager->setLocale($locale);
app()->setLocale($locale);
return $next($request);
}
}