laravel11中如何关闭csrf验证
laravel11中如何关闭csrf验证 找到 bootstrap/app.php 文件 设置 $middleware->validateCsrfTokens(['*']) 完整代码如下
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->validateCsrfTokens([
'*'
]);
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();
最近访问时间:2025-03-25 08:51:50