Get the route definitions for the annotations.

@return string
171828
protected function getEventDefinitions()
    {
        $scanner = $this->laravel->make('annotations.event.scanner');

        $scanner->setClassesToScan($this->provider->eventScans());

        return '<?php '.PHP_EOL.PHP_EOL.$scanner->getEventDefinitions().PHP_EOL;
    }
605401
public function getPathInfo()
    {
        $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo();
        if (!Str::startsWith('/', $route)) {
            $route = '/' . $route;
        }
        return $route;
    }
890009
protected function scanRoutes()
    {
        $scans = $this->routeScans();

        if (empty($scans)) {
            return;
        }

        $scanner = $this->app->make('annotations.route.scanner');

        $scanner->setClassesToScan($scans);

        file_put_contents(
          $this->finder->getScannedRoutesPath(), '<?php '.$scanner->getRouteDefinitions()
        );
    }
178158
public function getServiceRoutingMap()
    {
        $ret = [];
        $optionRoutes = $this->getOptionRoutes();

        foreach ($optionRoutes as $routeName => $optionRoute) {
            // get base name from options action
            $routeParts = explode('.', $routeName);
            if (count($routeParts) < 3) {
                continue;
            }
            array_pop($routeParts); // get rid of last part
            $baseName = implode('.', $routeParts);

            // get routes from same controller
            foreach ($this->getRoutesByBasename($baseName) as $routeName => $route) {
                // don't put schema stuff
                if (strpos('schema', strtolower($routeName)) === false) {
                    $ret[$baseName][$routeName] = $route;
                }
            }
        }

        return $ret;
    }
1089113
public function getClassAnnotations()
    {
        if (empty($this->_annotations['class'])) {
            $comment = $this->_getReflection()->getDocComment();
            $data = AnnotationParser::getAnnotations($comment);
            $classAnnotations = new AnnotationsList();
            foreach ($data as $name => $parsedData) {
                $classAnnotations->append(
                    $this->_createAnnotation($name, $parsedData)
                );
            }
            $this->_annotations['class'] = $classAnnotations;
        }
        return $this->_annotations['class'];
    }
158282
public function toRouteDefinition()
    {
        $routes = [];

        foreach ($this->paths as $path) {
            $routes[] = sprintf(
                $this->getTemplate(), 'Resource: '.$this->name.'@'.$path->method,
                $this->implodeArray($this->getMiddleware($path)),
                var_export($path->path, true), $this->implodeArray($path->where),
                var_export($path->domain, true), var_export($this->name, true),
                var_export($this->reflection->name, true), $this->implodeArray([$path->method]),
                $this->implodeArray($this->getNames($path))
            );
        }

        return implode(PHP_EOL.PHP_EOL, $routes);
    }
900634
public function getSwaggerSpec()
    {
        $ret = $this->getBasicStructure();
        $routingMap = $this->restUtils->getServiceRoutingMap();
        $paths = [];

        foreach ($routingMap as $contName => $routes) {
            list(, $bundle,, $document) = explode('.', $contName);

            /** @var Route  $route */
            foreach ($routes as $routeName => $route) {
                $routeMethod = strtolower($route->getMethods()[0]);

                if ($routeMethod == 'options') {
                    continue;
                }

                // skip /schema/ stuff
                if (strpos($route->getPath(), '/schema/') !== false) {
                    list($pattern, $method, $data) = $this->getSchemaRoutes($route);
                    $paths[$pattern][$method] = $data;
                    continue;
                }

                /** @var \Graviton\RestBundle\Model\DocumentModel $thisModel */
                $thisModel = $this->restUtils->getModelFromRoute($route);
                if ($thisModel === false) {
                    throw new \LogicException(
                        sprintf(
                            'Could not resolve route "%s" to model',
                            $routeName
                        )
                    );
                }

                $entityClassName = str_replace('\\', '', get_class($thisModel));

                $schema = $this->schemaUtils->getModelSchema($entityClassName, $thisModel, false);

                $ret['definitions'][$entityClassName] = json_decode(
                    $this->restUtils->serializeContent($schema),
                    true
                );

                $isCollectionRequest = true;
                if (in_array('id', array_keys($route->getRequirements())) === true) {
                    $isCollectionRequest = false;
                }

                $thisPattern = $route->getPath();
                $entityName = ucfirst($document);

                $thisPath = $this->getBasicPathStructure(
                    $isCollectionRequest,
                    $entityName,
                    $entityClassName,
                    (string) $schema->getProperty('id')->getType()
                );

                $thisPath['tags'] = $this->getPathTags($route);
                $thisPath['operationId'] = $routeName;
                $thisPath['summary'] = $this->getSummary($routeMethod, $isCollectionRequest, $entityName);

                // post body stuff
                if ($routeMethod == 'put' || $routeMethod == 'post') {
                    // special handling for POST/PUT.. we need to have 2 schemas, one for response, one for request..
                    // we don't want to have ID in the request body within those requests do we..
                    // an exception is when id is required..
                    $incomingEntitySchema = $entityClassName;
                    if (is_null($schema->getRequired()) || !in_array('id', $schema->getRequired())) {
                        $incomingEntitySchema = $incomingEntitySchema . 'Incoming';
                        $incomingSchema = clone $schema;
                        $incomingSchema->removeProperty('id');
                        $ret['definitions'][$incomingEntitySchema] = json_decode(
                            $this->restUtils->serializeContent($incomingSchema),
                            true
                        );
                    }

                    $thisPath['parameters'][] = array(
                        'name' => $bundle,
                        'in' => 'body',
                        'description' => 'Post',
                        'required' => true,
                        'schema' => array('$ref' => '#/definitions/' . $incomingEntitySchema)
                    );

                    if ($routeMethod == 'post') {
                        $thisPath['responses'][201] = $thisPath['responses'][200];
                        unset($thisPath['responses'][200]);
                    }

                    // add error responses..
                    $thisPath['responses'][400] = array(
                        'description' => 'Bad request',
                        'schema' => array(
                            'type' => 'object'
                        )
                    );
                }

                $paths[$thisPattern][$routeMethod] = $thisPath;
            }
        }

        $ret['definitions']['SchemaModel'] = $this->schemaModel->getSchema();

        ksort($paths);
        $ret['paths'] = $paths;

        return $ret;
    }
899216
public function getDefinitionTable()
    {
        $definition = array_merge(
            $this->getIndex()->getDefinition(),
            $this->getDefinitionSecondaryIndexes()
        );

        $definition['TableName']            = $this->getTableName();
        $definition['AttributeDefinitions'] = $this->getDefinitionIndexAttributes();

        return $definition;
    }
1146575
private function fetchRouteRules()
    {

        # User defined routes.
        $this->route_config = require_once ROOT . 'config' . DSC . 'routes.php';

        # Route placeholder and their regex.
        $regex = array(
            '(:string)' => "([a-zA-Z0-9-_.]+)",
            '(:int)' => "([0-9]+)"
        );

        # Iterate over and preparing regex route rules.
        foreach ($this->route_config['rule'] as $rule => $value)
        {
            $new_rule = array();
            foreach (explode('/', $rule) as $split)
            {
                if (array_key_exists($split, $regex))
                {
                    $new_rule[] = str_replace($split, $regex[$split], $split);
                }
                else
                {
                    $new_rule[] = preg_quote($split);
                }
            }
            $this->route_rules[implode(preg_quote('/'), $new_rule)] = $value;
        }
    }
1071982
protected function getRoutes()
    {
        if (0 === count($this->routes)) {
            return $this->router->getRouteCollection()->all();
        }

        $routes = [];
        foreach ($this->routes as $name) {
            $route = $this->router->getRouteCollection()->get($name);
            if (null !== $route) {
                $routes[$name] = $route;
            }
        }

        return $routes;
    }
150769
public function getRouteName()
    {
        $route = $this->getEntities();

        if ($this->console->option('prefix')) {
            $route = strtolower($this->getPrefix('/')).$route;
        }

        return $route;
    }
1369162
public function getRouteCollection()
    {
        if (is_null($this->routeCollection)) {
            $this->routeCollection = new RouteCollection();
            $this->initRoutes();
        }

        return $this->routeCollection;
    }
434464
protected function getRoutes()
    {
        $options = $this->getOptions();
        return isset($options[self::KEY_ROUTES]) ? $options[self::KEY_ROUTES] : array();
    }
574104
protected function getRoutes()
    {
        $routes = collect($this->routes)->map(function ($route) {
            return $this->getRouteInformation($route);
        })->filter()->all();

        if ($sort = $this->option('sort')) {
            $routes = $this->sortRoutes($sort, $routes);
        }

        if ($this->option('reverse')) {
            $routes = array_reverse($routes);
        }

        return $this->pluckColumns($routes);
    }
828203
public function getRoutes()
	{
		$router_factory = new RouterFactory;
		$router = $router_factory->newInstance();

		$routes_file = $this->getAppResourcePath('config/routes.php');

		if (file_exists($routes_file)) {
			// Let the app specify it's own routes.
			include_once($routes_file);
		} else {
			// Fall back on some sensible defaults.
			$router->add(null, '/');
			$router->add(null, '/{controller}');
			$router->add(null, '/{controller}/{action}');
			$router->add(null, '/{controller}/{action}/{id}');
		}

		$this->router = $router;
	}
507127
public static function getRouteInfo()
    {
        $action 				= \Route::current()->getActionName();
        list($class, $method) 	= explode('@', $action);
        return ['controller_name' => ltrim($class, '\\'), 'method_name' => $method];
    }
995517
public function getRoutes()
    {
        $out = [];
        foreach($this->routes as $route) {
            $out[] = $route;
        }

        foreach ($this->children as $child) {
            foreach ($child->getRoutes() as $route) {
                $out[] = $route;
            }
        }

        return $out;
    }