/** * @param AbstractGenerator $generator * @param $allowedRoutes * @param $routePrefix * * @return array */ private function processDingoRoutes(AbstractGenerator $generator, $allowedRoutes, $routePrefix, $middleware) { $withResponse = $this->option('noResponseCalls') === false; $routes = $this->getRoutes(); $bindings = $this->getBindings(); $parsedRoutes = []; foreach ($routes as $route) { if (empty($allowedRoutes) || in_array($route->getName(), $allowedRoutes) || str_is($routePrefix, $route->uri()) || in_array($middleware, $route->middleware())) { if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) { $parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse); $this->info('Processed route: [' . implode(',', $route->getMethods()) . '] ' . $route->uri()); } else { $this->warn('Skipping route: [' . implode(',', $route->getMethods()) . '] ' . $route->uri()); } } } return $parsedRoutes; }