當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。