This commit is contained in:
Richard Dern
2022-01-12 00:35:37 +01:00
commit 400e3d01f1
1363 changed files with 57778 additions and 0 deletions

27
app/Http/Middleware/SetLang.php Executable file
View File

@@ -0,0 +1,27 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class SetLang
{
/**
* Handle an incoming request.
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
$lang = config('app.locale');
if ($request->user()) {
$lang = $request->user()->lang;
}
app()->setLocale(trim($lang));
return $next($request);
}
}