初始化

This commit is contained in:
2026-03-02 13:44:38 +08:00
commit 05b785083c
677 changed files with 58662 additions and 0 deletions

17
app/middleware/Lang.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
namespace app\middleware;
use Illuminate\Support\Str;
use Webman\Http\Request;
use Webman\Http\Response;
use Webman\MiddlewareInterface;
class Lang implements MiddlewareInterface
{
public function process(Request $request, callable $handler): Response
{
$lang = $request->header('Lang') ?? 'zh_CN';
locale(session('lang', Str::replace('-', '_', $lang)));
return $handler($request);
}
}