成功提取了instamojo api的响应,但问题是,webhook服务无法正常工作。在这里我提供了一个webhook url请求,我想排除CSRF验证,因为我在中间件中包含了带'instamojo/*'
的Except数组,但仍然没用。
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'instamojo/*',
];
}
当前路线
Route::post('webhook','HomeController@webhook');
答案 0 :(得分:0)
可以通过在中间件的“例外”部分添加发布路线名称来解决。
在这里,我在中间件中添加了webhook/*
。
路线
Route::post('webhook','HomeController@webhook');
中间件
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'webhook/*',
];
}
很好,谢谢。