Ekapp/skolehjem/app/Http/Middleware/SetLocale.php

22 lines
394 B
PHP
Raw Normal View History

2020-08-07 06:52:01 +00:00
<?php
namespace App\Http\Middleware;
use Closure;
class SetLocale
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
app()->setLocale($request->user()->getLocale($request));
return $next($request);
}
}