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


PHP Route::middleware方法代碼示例

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


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

示例1: gatherRouteMiddlewares

 /**
  * Gather the middleware for the given route.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 public function gatherRouteMiddlewares(Route $route)
 {
     return Collection::make($route->middleware())->map(function ($name) {
         return Collection::make($this->resolveMiddlewareClassName($name));
     })->flatten()->all();
 }
開發者ID:PrakharSrivastav,項目名稱:bookbarterclub,代碼行數:12,代碼來源:Router.php

示例2: prepareMiddlewares

 private function prepareMiddlewares(\Illuminate\Routing\Route $route)
 {
     /** @var array $middleware */
     $middleware = $route->middleware();
     return method_exists($route, 'controllerMiddleware') ? array_merge($middleware, $route->controllerMiddleware()) : $middleware;
 }
開發者ID:arcanesoft,項目名稱:foundation,代碼行數:6,代碼來源:RoutesViewer.php

示例3: gatherRouteMiddlewares

 /**
  * Gather the middleware for the given route.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 protected function gatherRouteMiddlewares(Route $route)
 {
     return Collection::make($route->middleware())->map(function ($m) {
         return array_get($this->middleware, $m, $m);
     })->all();
 }
開發者ID:hramose,項目名稱:Sistema-Control-de-Almacen,代碼行數:12,代碼來源:Router.php

示例4: gatherRouteMiddlewares

 /**
  * Gather the middleware for the given route.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 public function gatherRouteMiddlewares(Route $route)
 {
     return Collection::make($route->middleware())->map(function ($m) {
         return Collection::make(array_get($this->middleware, $m, $m));
     })->collapse()->all();
 }
開發者ID:betes-curieuses-design,項目名稱:ElieJosiePhotographie,代碼行數:12,代碼來源:Router.php

示例5: getMiddleware

 /**
  * Get before filters.
  *
  * @param \Illuminate\Routing\Route $route        	
  * @return string
  */
 protected function getMiddleware($route)
 {
     $middlewares = array_values($route->middleware());
     $middlewares = array_unique(array_merge($middlewares, $this->getPatternFilters($route)));
     $actionName = $route->getActionName();
     if (!empty($actionName) && $actionName !== 'Closure') {
         $middlewares = array_merge($middlewares, $this->getControllerMiddleware($actionName));
     }
     return implode(',', $middlewares);
 }
開發者ID:ngitimfoyo,項目名稱:Nyari-AppPHP,代碼行數:16,代碼來源:RouteListCommand.php

示例6: getMiddleware

 /**
  * Get before filters
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return string
  */
 protected function getMiddleware($route)
 {
     $middleware = array_values($route->middleware());
     $middleware = array_unique(array_merge($middleware, $this->getPatternFilters($route)));
     return implode(', ', $middleware);
 }
開發者ID:fparralejo,項目名稱:btrabajo,代碼行數:12,代碼來源:RouteListCommand.php

示例7: getMiddleware

 /**
  * Get middleware
  *
  * @param  \Illuminate\Routing\Route $route
  * @return string
  */
 protected function getMiddleware($route)
 {
     $middleware = array_keys($route->middleware());
     return implode(', ', $middleware);
 }
開發者ID:focuslife,項目名稱:v0.1,代碼行數:11,代碼來源:IlluminateRouteCollector.php

示例8: gatherRouteMiddlewares

 /**
  * Gather the middleware for the given route.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 public function gatherRouteMiddlewares(Route $route)
 {
     $result = [];
     foreach ($route->middleware() as $tag) {
         $result[] = isset($this->middleware[$tag]) === true ? $this->middleware[$tag] : $tag;
     }
     return $result;
 }
開發者ID:maple-leaf,項目名稱:rhw-l5,代碼行數:14,代碼來源:Router.php


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