protected function filterRouteAsClass(Route $route)
 {
     if ($this->option('name') && !str_contains($route->getName(), $this->option('name')) || $this->option('path') && !str_contains(implode('|', $route->methods()) . ' ' . $route->uri(), $this->option('path'))) {
         return null;
     }
     return $route;
 }
 /**
  * Add the given route to the arrays of routes.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return void
  */
 protected function addToCollections($route)
 {
     foreach ($route->methods() as $method) {
         $this->routes[$method][$route->domain() . $route->getUri()] = $route;
     }
     $this->allRoutes[$method . $route->domain() . $route->getUri()] = $route;
 }
Пример #3
0
 /**
  * Add the given route to the arrays of routes.
  *
  * @param  \Illuminate\Routing\Route $route
  * @return void
  */
 protected function addToCollections($route)
 {
     $domainAndUri = $route->domain() . $route->getUri() . $route->getPriority();
     foreach ($route->methods() as $method) {
         $this->routes[$method][$domainAndUri] = $route;
     }
     $this->allRoutes[$method . $domainAndUri] = $route;
 }
 /**
  * Get all of the pattern filters matching the route.
  *
  * @param  \Illuminate\Routing\Route $route
  * @return array
  */
 protected function getPatternFilters($route)
 {
     $patterns = array();
     foreach ($route->methods() as $method) {
         // For each method supported by the route we will need to gather up the patterned
         // filters for that method. We will then merge these in with the other filters
         // we have already gathered up then return them back out to these consumers.
         $inner = $this->getMethodPatterns($route->uri(), $method);
         $patterns = array_merge($patterns, array_keys($inner));
     }
     return $patterns;
 }
Пример #5
0
 public function isAlternate(LaravelRoute $route)
 {
     if (!$route instanceof Route) {
         return false;
     }
     // Validate methods
     if ($this->methods() != $route->methods()) {
         return false;
     }
     // Validate scheme
     if ($this->httpOnly() !== $route->httpOnly()) {
         return false;
     }
     // Validate base uri
     if ($this->getBaseUri() !== $route->getBaseUri()) {
         return false;
     }
     if ($this->getUri() === $route->getUri()) {
         return false;
     }
     return true;
 }
Пример #6
0
 /**
  * Validate a given rule against a route and request.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @param  \Illuminate\Http\Request  $request
  * @return bool
  */
 public function matches(Route $route, Request $request)
 {
     return in_array($request->getMethod(), $route->methods());
 }
 protected function getRouteInformation(Route $route)
 {
     $uri = implode('|', $route->methods()) . ' ' . $route->uri();
     return $this->filterRoute(['uri' => $uri, 'name' => $route->getName(), 'before' => $this->getBeforeFilters($route), 'after' => $this->getAfterFilters($route)]);
 }
Пример #8
0
 /**
  * @param \Illuminate\Routing\Route $route
  *
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return $this->filterRoute(['host' => $route->domain(), 'method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName(), 'middleware' => $this->getMiddleware($route)]);
 }
Пример #9
0
 /**
  * Get the route information for a given route.
  *
  * @param \Illuminate\Routing\Route $route
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return $this->filterRoute(array('host' => $route->domain(), 'uri' => implode('|', $route->methods()) . ' ' . $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName(), 'version' => implode(', ', array_get($route->getAction(), 'version')), 'protected' => array_get($route->getAction(), 'protected') ? 'Yes' : 'No', 'scopes' => $this->getScopes($route)));
 }
 /**
  * Get all of the pattern filters matching the route.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 protected function getPatternFilters($route)
 {
     $patterns = [];
     foreach ($route->methods() as $method) {
         $inner = $this->getMethodPatterns($route->uri(), $method);
         $patterns = array_merge($patterns, array_keys($inner));
     }
     return $patterns;
 }
Пример #11
0
 /**
  * Get the route information for a given route.
  *
  * @param  string  $name
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     $uri = implode('|', $route->methods()) . ' ' . $route->uri();
     return $this->filterRoute(array('host' => $route->domain(), 'uri' => $uri, 'name' => $route->getName(), 'action' => $route->getActionName(), 'prefix' => $route->getPrefix(), 'method' => $route->methods()[0]));
 }
Пример #12
0
 /**
  * @param Route $route
  *
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return ['method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName()];
 }
Пример #13
0
 private function getRouteMethod(Route $route)
 {
     $methods = $route->methods();
     return Arr::first($methods);
 }
Пример #14
0
 /**
  * Get the route information for a given route.
  *
  * @param  \Illuminate\Routing\Route $route
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return $this->filterRoute(['uri' => $route->uri(), 'methods' => $route->methods(), 'name' => $route->getName(), 'action' => $route->getActionName()]);
 }