當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::getFacadeRoot方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Request::getFacadeRoot方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getFacadeRoot方法的具體用法?PHP Request::getFacadeRoot怎麽用?PHP Request::getFacadeRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Request的用法示例。


在下文中一共展示了Request::getFacadeRoot方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getLogin

 /**
  * Show the application login form.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogin()
 {
     //dd("loaded");
     // get the current request object
     //Throttle::clear();
     $request = Request::getFacadeRoot();
     //dd($request);
     // throttler object for that request, X, Y
     // X = tries, Y = minutes
     $throttler = Throttle::get($request, Config::get('kagi.throttle', '3'), Config::get('kagi.time_out', '2'));
     //dd($throttler);
     /*
     // check if we've gone over the limit
     		var_dump($throttler->check());
     // implement Countable
     		var_dump($throttler->count());
     // the attempt function will hit the throttle, then return check
     		var_dump(Throttle::attempt($request));
     */
     // Check throttle, return with error
     if (!Throttle::attempt($request, 5)) {
         Flash::error(trans('kotoba::auth.error.not_approved'));
     }
     return Theme::View('modules.kagi.auth.login');
 }
開發者ID:duyluonglc,項目名稱:rakko,代碼行數:30,代碼來源:KagiAuthandRegister.php

示例2: getDefaultRequest

 /**
  * Get a default request value, if any is available
  *
  * @return Request|null A default request value or Null if no default value is available
  */
 public function getDefaultRequest()
 {
     return RequestFacade::getFacadeRoot();
 }
開發者ID:aedart,項目名稱:laravel-helpers,代碼行數:9,代碼來源:RequestTrait.php

示例3: validateSignedURL

 public function validateSignedURL($actual_url, $signed_url, $substitions)
 {
     $current_route = Request::route();
     $current_route_name = $current_route->getName();
     if (isset($substitions[$current_route_name])) {
         $substition = $substitions[$current_route_name];
         // make sure the host of the signed URL matches the host of the substitution URL
         if (isset($substition['host'])) {
             $signed_host = $this->getHostFromURL($signed_url);
             $allowed_host = $substition['host'];
             if ($signed_host != $allowed_host) {
                 Log::debug("HOST MISMATCH: \$signed_host={$signed_host} \$allowed_host={$allowed_host}");
                 // no host match - return false
                 return false;
             }
         }
         // check the route
         $substitute_route = new Route($current_route->getMethods(), $substition['route'], []);
         $signed_request = \Illuminate\Http\Request::create($signed_url, Request::method());
         if ($substitute_route->matches($signed_request)) {
             // the allowed substitute route matches the signed request
             return true;
         }
         Log::debug("ROUTE MISMATCH: pathinfo=" . json_encode(Request::getFacadeRoot()->getPathInfo()) . " allowed route={$substition['route']}");
     }
     // this signed URL was not valid
     return false;
 }
開發者ID:tokenly,項目名稱:laravel-api-provider,代碼行數:28,代碼來源:AuthenticateProtectedAPIRequest.php

示例4: getRequest

 /**
  * Returns an instance of the current request
  *
  * @return \Illuminate\Http\Request|null Request or null if not available
  */
 public function getRequest()
 {
     return Request::getFacadeRoot();
 }
開發者ID:aedart,項目名稱:laravel-helpers,代碼行數:9,代碼來源:CookieTrait.php


注:本文中的Illuminate\Support\Facades\Request::getFacadeRoot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。