Boot a fresh copy of the application and get the routes.

@return \Illuminate\Routing\RouteCollection
480706
protected function getFreshApplicationRoutes()
	{
		$app = require $this->laravel->basePath().'/bootstrap/app.php';

		$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

		return $app['router']->getRoutes();
	}
997935
public function getRouteCollectionForRequest(Request $request)
    {
        $collection = new RouteCollection();
        $path       = $this->getNormalizedPath($request);
        $resource   = $this->repository->findOneBy(['path' => $path]);
        
        if ($resource) {
            $route = $this->createRoute($resource);
            $collection->add(
                self::DYNAMIC_PREFIX . $resource->getId(),
                $route
            );
        }
        
        return $collection;
    }
998082
public function collectRoutes()
    {
        $routes = [];

        foreach($this->getCollectors() as $collector) {
            $routes = array_merge($routes, $collector->collectRoutes());
        }

        return $routes;
    }
169069
protected function buildRouter()
    {
        $routes = new RouteCollection();
        $context = new RequestContext();
        $router = new UrlMatcher($routes, $context);

        return($router);
    }
132781
public function boot()
    {
        parent::boot();

        
        if (Request::is('*/pricelist/price_list/*')) {
            Route::bind('price_list', function ($price_list) {
                $price_listrepo = $this->app->make('Litecms\Pricelist\Interfaces\PriceListRepositoryInterface');
                return $price_listrepo->findorNew($price_list);
            });
        }

    }
970068
protected function loadAdminRouteData() {
    if (!isset($this->adminRoutesData)) {
      $this->adminRoutesData = $this->environment->getStorage()->retrieve('admin_routes');
    }

    return $this->adminRoutesData;
  }
957370
protected function getFreshApplicationRoutes()
    {
        return tap($this->getFreshApplication()['router']->getRoutes(), function ($routes) {
            /** @var RouteCollection $routes */
            $routes->refreshNameLookups();
            $routes->refreshActionLookups();
        });
    }
378608
public function getRoutes()
    {
        $manager = Configs::authManager();
        // Get advanced configuration
        $advanced = Configs::instance()->advanced;
        if ($advanced) {
            // Use advanced route scheme.
            // Set advanced route prefix.
            $this->_routePrefix = self::PREFIX_ADVANCED;
            // Create empty routes array.
            $routes = [];
            // Save original app.
            $yiiApp = Yii::$app;
            // Step through each configured application
            foreach ($advanced as $id => $configPaths) {
                // Force correct id string.
                $id = $this->routePrefix . ltrim(trim($id), $this->routePrefix);
                // Create empty config array.
                $config = [];
                // Assemble configuration for current app.
                foreach ($configPaths as $configPath) {
                    // Merge every new configuration with the old config array.
                    $config = yii\helpers\ArrayHelper::merge($config, require (Yii::getAlias($configPath)));
                }
                // Create new app using the config array.
                unset($config['bootstrap']);
                $app = new yii\web\Application($config);
                // Get all the routes of the newly created app.
                $r = $this->getAppRoutes($app);
                // Dump new app
                unset($app);
                // Prepend the app id to all routes.
                foreach ($r as $route) {
                    $routes[$id . $route] = $id . $route;
                }
            }
            // Switch back to original app.
            Yii::$app = $yiiApp;
            unset($yiiApp);
        } else {
            // Use basic route scheme.
            // Set basic route prefix
            $this->_routePrefix = self::PREFIX_BASIC;
            // Get basic app routes.
            $routes = $this->getAppRoutes();
        }
        $exists = [];
        foreach (array_keys($manager->getPermissions()) as $name) {
            if ($name[0] !== $this->routePrefix) {
                continue;
            }
            $exists[] = $name;
            unset($routes[$name]);
        }
        return [
            'available' => array_keys($routes),
            'assigned' => $exists,
        ];
    }
896596
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {
            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('menus', 'AdminController@index')->name('admin::index-menus')->middleware('can:see-all-menus');
                $router->get('menus/create', 'AdminController@create')->name('admin::create-menu')->middleware('can:create-menu');
                $router->get('menus/{menu}/edit', 'AdminController@edit')->name('admin::edit-menu')->middleware('can:update-menu');
                $router->post('menus', 'AdminController@store')->name('admin::store-menu')->middleware('can:create-menu');
                $router->put('menus/{menu}', 'AdminController@update')->name('admin::update-menu')->middleware('can:update-menu');

                $router->get('menus/{menu}/menulinks/create', 'MenulinksAdminController@create')->name('admin::create-menulink')->middleware('can:create-menu');
                $router->get('menus/{menu}/menulinks/{menulink}/edit', 'MenulinksAdminController@edit')->name('admin::edit-menulink')->middleware('can:update-menu');
                $router->post('menus/{menu}/menulinks', 'MenulinksAdminController@store')->name('admin::store-menulink')->middleware('can:create-menu');
                $router->put('menus/{menu}/menulinks/{menulink}', 'MenulinksAdminController@update')->name('admin::update-menulink')->middleware('can:update-menu');
            });

            /*
             * API routes
             */
            $router->middleware('api')->prefix('api')->group(function (Router $router) {
                $router->middleware('auth:api')->group(function (Router $router) {
                    $router->get('menus', 'ApiController@index')->middleware('can:see-all-menus');
                    $router->patch('menus/{menu}', 'ApiController@updatePartial')->middleware('can:update-menu');
                    $router->delete('menus/{menu}', 'ApiController@destroy')->middleware('can:delete-menu');

                    $router->get('menus/{menu}/menulinks', 'MenulinksApiController@index')->middleware('can:see-all-menus');
                    $router->patch('menus/{menu}/menulinks/{menulink}', 'MenulinksApiController@updatePartial')->middleware('can:update-menu');
                    $router->post('menus/{menu}/menulinks/sort', 'MenulinksApiController@sort')->middleware('can:update-menu');
                    $router->delete('menus/{menu}/menulinks/{menulink}', 'MenulinksApiController@destroy')->middleware('can:delete-menu');
                });
            });
        });
    }
756389
public function detectRoutes()
    {
        $components = $this->detectUiComponents();

        $return = [];
        foreach ($components as $component) {
            $name      = $this->files->name($component);
            $namespace = $this->resolveUIComponentNamespace($this->files->get($component));
            $return[]  = $namespace . '\\' . $name;
        }
        return new Collection($return);
    }
1049065
public function getRoutes() : array {
        $request = get_request();
        $requestMethod = $request->method();
        $requestPathParts = $request->pathParts();
        $routesIndex = $this->routesIndex;
        $routes = [];
        $this->getRoutesFromIndex($routes,$routesIndex, $requestMethod, $requestPathParts);
        return $routes;
    }
105825
public static function reload()
    {
        if (empty(static::$_initialState)) {
            static::$_collection = new RouteCollection();
            static::$_initialState = get_class_vars(get_called_class());

            return;
        }
        foreach (static::$_initialState as $key => $val) {
            if ($key !== '_initialState') {
                static::${$key} = $val;
            }
        }
        static::$_collection = new RouteCollection();
    }
355833
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {

            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('dashboard', 'AdminController@dashboard')->name('dashboard')->middleware('can:see-dashboard');
                $router->get('', 'AdminController@index')->middleware('can:see-dashboard');
            });
        });
    }
532307
protected function prepareRouteCollection()
    {
        $builder = Router::createRouteBuilder('/');
        $this->app->routes($builder);
        if ($this->app instanceof PluginApplicationInterface) {
            $this->app->pluginRoutes($builder);
        }

        return Router::getRouteCollection();
    }
749986
public function getRoutes($version = null)
    {
        $routes = $this->adapter->getIterableRoutes($version);

        if (! is_null($version)) {
            $routes = [$version => $routes];
        }

        $collections = [];

        foreach ($routes as $key => $value) {
            $collections[$key] = new RouteCollection($this->container['request']);

            foreach ($value as $route) {
                $route = $this->createRoute($route);

                $collections[$key]->add($route);
            }
        }

        return is_null($version) ? $collections : $collections[$version];
    }
35412
protected function bindRepositories()
    {
        $this->app->singleton(RoutesService::class, function () {
            return new RoutesService();
        });

        $this->app->singleton(LanguageService::class, function () {
            return new LanguageService(
                cache()->rememberForever('languages', function () {
                    return Language::all();
                })
            );
        });

        $this->app->singleton('croppa.src_dir', function () {
            return resolve('filesystem')->disk(config('gzero.upload.disk'))->getDriver();
        });
    }
714018
public function flush()
    {
        if (null === $this->routesFactory) {
            $routes = new RouteCollection();
        } else {
            $routes = $this->routesFactory;
        }

        return $this->doFlush('', $routes);
    }