全部頁面開啓和關閉CSRF 參考:http://www.cnblogs.com/HD/p/4555369.htmlphp
部分頁面不須要使用CSRFhtml
/** * 指定頁面不開啓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); }