Mailgun 假设向 laravel 应用程序发送一个 post 请求,每次它发送这样的请求 Laravel 都会停止请求并出现错误
throw new Illuminate\Session\TokenMismatchException;
我想不出解决这个问题的方法?
我正在使用 laravel 4.1
通过将路由的 URI 添加$except
到VerifyCsrfToken
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'stripe/*',
'http://example.com/foo/bar',
'http://example.com/foo/*',
];
}