v0.5.7b - Added middelware
This commit is contained in:
parent
e5e057a51a
commit
60391793fc
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue