v2board/app/Http/Middleware/Language.php
2021-01-20 19:51:55 +09:00

18 lines
332 B
PHP
Executable File

<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\App;
class Language
{
public function handle($request, Closure $next)
{
if ($request->header('content-language')) {
App::setLocale($request->header('content-language'));
}
return $next($request);
}
}