Home >Backend Development >PHP Tutorial >Laravel5 开启关闭 CSRF token 方法
所有页面开启和关闭CSRF 参考:http://www.cnblogs.com/HD/p/4555369.html
部分页面不需要使用CSRF
/*** 指定页面不开启CSRF* @var string*/ private $openRoutes = ['test/url']; /*** Handle an incoming request.* @param \Illuminate\Http\Request $request* @param \Closure $next* @return mixed*/public function handle($request, Closure $next){ if (in_array($request->path(), $this->openRoutes)) { return $next($request); } return parent::handle($request, $next);}