当前位置: 首页>>代码示例>>PHP>>正文


PHP VerifyCsrfToken::handle方法代码示例

本文整理汇总了PHP中Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::handle方法的典型用法代码示例。如果您正苦于以下问题:PHP VerifyCsrfToken::handle方法的具体用法?PHP VerifyCsrfToken::handle怎么用?PHP VerifyCsrfToken::handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Foundation\Http\Middleware\VerifyCsrfToken的用法示例。


在下文中一共展示了VerifyCsrfToken::handle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 public function handle($request, \Closure $next)
 {
     try {
         return parent::handle($request, $next);
     } catch (TokenMismatchException $e) {
         return $this->unauthorizedResponse();
     }
 }
开发者ID:deadem,项目名称:djem,代码行数:8,代码来源:VerifyCsrfToken.php

示例2: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (strpos($request, 'infusion')) {
         return $this->addCookieToResponse($request, $next($request));
     }
     return parent::handle($request, $next);
 }
开发者ID:keiwerkgvr,项目名称:salesperformanceindicator,代码行数:14,代码来源:VerifyCsrfToken.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->shouldIgnore($request)) {
         return $this->addCookieToResponse($request, $next($request));
     }
     return parent::handle($request, $next);
 }
开发者ID:devisephp,项目名称:cms,代码行数:14,代码来源:VerifyCsrfToken.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ('testing' !== app()->environment()) {
         return parent::handle($request, $next);
     }
     return $next($request);
 }
开发者ID:berkapavel,项目名称:Laravel5-Time-Tracker-Project-manager,代码行数:14,代码来源:VerifyCsrfToken.php

示例5: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userKey = $request->input('_key');
     if ($userKey && !empty($userKey)) {
         $user = User::where('user_key', $userKey)->first();
         if (Auth::check()) {
             $prevuser = Auth::user();
             Auth::logout();
         }
         if ($user->exists()) {
             Auth::login($user);
             $response = $next($request);
             Auth::logout();
             if (isset($prevuser) && isset($prevuser->id)) {
                 Auth::login($prevuser);
             }
             return $response;
         } else {
             $response = $next($request);
         }
         if (isset($prevuser)) {
             Auth::login($prevuser);
         }
         return $response;
     }
     if ($request->is('api/v1/donate/ipn')) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:RobinJ1995,项目名称:VacStatus,代码行数:37,代码来源:VerifyCsrfToken.php

示例6: handle

 public function handle($request, Closure $next)
 {
     if ($request->ajax()) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:rosemalejohn,项目名称:dnsc-hris,代码行数:7,代码来源:VerifyCsrfToken.php

示例7: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (\App::environment() == 'testing') {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:hlmasterchief,项目名称:plock,代码行数:14,代码来源:VerifyCsrfToken.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (strpos($request->getRequestUri(), 'queue') >= 0) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:janusnic,项目名称:imgubox,代码行数:14,代码来源:VerifyCsrfToken.php

示例9: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!\Request::is('ws/*') && !\Request::ajax()) {
         return parent::handle($request, $next);
     }
     return $this->addCookieToResponse($request, $next($request));
 }
开发者ID:bilel99,项目名称:tetris_webservice,代码行数:14,代码来源:VerifyCsrfToken.php

示例10: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request instanceof Request) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:jenky,项目名称:muzik,代码行数:15,代码来源:VerifyCsrfToken.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->method() == 'POST') {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:lanhongjie,项目名称:todoApp,代码行数:14,代码来源:VerifyCsrfToken.php

示例12: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->is('admin/upload')) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:x303597316,项目名称:inspirer,代码行数:15,代码来源:VerifyCsrfToken.php

示例13: handle

 /**
  * {@inheritDoc}
  */
 public function handle($request, Closure $next)
 {
     if (is_api_request()) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:linuxssm,项目名称:l5essential,代码行数:10,代码来源:VerifyCsrfToken.php

示例14: handle

 public function handle($request, Closure $next)
 {
     if (!$request->is("api/*")) {
         return parent::handle($request, $next);
     }
     return $next($request);
 }
开发者ID:Insantani,项目名称:SourceTree-diovi,代码行数:7,代码来源:VerifyCsrfToken.php

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->getRequestUri() == '/en/update/docs') {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:Houbsi,项目名称:Website,代码行数:14,代码来源:VerifyCsrfToken.php


注:本文中的Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::handle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。