表单提交数据报错。
为什么我在表单里输入数据后,点击提交,结果报错了呢?Whoops, looks like something went wrong. TokenMismatchException in VerifyCsrfToken.php line 46:
为什么我在表单里输入数据后,点击提交,结果报错了呢?Whoops, looks like something went wrong. TokenMismatchException in VerifyCsrfToken.php line 46:
2016-10-12
你也可以通过将这类 URI 添加到 VerifyCsrfToken 中间件中的 $except 属性来排除对这类路由的 CSRF 保护:
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
'student/*',
];
}举报