/**
  * 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();
 }
 private function prepareMiddlewares(\Illuminate\Routing\Route $route)
 {
     /** @var array $middleware */
     $middleware = $route->middleware();
     return method_exists($route, 'controllerMiddleware') ? array_merge($middleware, $route->controllerMiddleware()) : $middleware;
 }
 /**
  * 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();
 }
 /**
  * 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();
 }
 /**
  * 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);
 }
 /**
  * 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);
 }
 /**
  * Get middleware
  *
  * @param  \Illuminate\Routing\Route $route
  * @return string
  */
 protected function getMiddleware($route)
 {
     $middleware = array_keys($route->middleware());
     return implode(', ', $middleware);
 }
Exemple #8
0
 /**
  * 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;
 }