Laravel5.2 will add Web middleware to routing by default. How to disable it?
web contains sessioncsrftoken. However, session and csrf are not used at all in the asynchronous notifications of Alipay and WeChat. How to disable.
I don’t want to touch the middleware configuration of verifycsrftoken.
Solved.
appHttpProvidersRouteServiceProvider.php
中mapRoute
取消强制给加上的web中间件调用。自己在自己的路由中需要的时候增加middleware=>web
That’s itTry not to modify it
app/Http/Kernel.php
,极不推荐关闭CSRF。修改
app/Http/Middleware/VerifyCsrfToken.php
to exclude the specified URL from CSRF verification./app/Http/Kernel.php
第31
行AppHttpMiddlewareVerifyCsrfToken::class,
Delete or commentIt would be better if you take your routing out of the web middleware group.