v0.5.7b - Added middelware

This commit is contained in:
Neerholt 2020-08-07 08:52:01 +02:00
parent e5e057a51a
commit 60391793fc
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?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);
}
}