/** * Get the route information for a given route. * * @param Route $route * * @return array|null */ protected function getRouteInformation(Route $route) { $route = parent::getRouteInformation($route); if (!$route) { return; } // Separate method and URI list($methods, $uri) = explode(' ', $route['uri']); $route['methods'] = $methods; $route['uri'] = $uri; return $route; }
/** * Get the console command options. * * @return array */ protected function getOptions() { return array_merge(parent::getOptions(), [['vers', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by version.'], ['scopes', 'S', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Filter the routes by scope(s)', null]]); }
/** * Create a new route command instance. * * @param \Illuminate\Routing\Router $router * @return void */ public function __construct(Router $router) { parent::__construct($router); $this->routes = $router->getApiRoutes(); }