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

22 lines
394 B
PHP

<?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);
}
}