Home > Backend Development > PHP Tutorial > Laravel5 开启关闭 CSRF token 方法

Laravel5 开启关闭 CSRF token 方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-20 12:39:42
Original
1148 people have browsed it

所有页面开启和关闭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);}
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template