当前位置: 首页>>代码示例>>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;未经允许,请勿转载。