Builds API routes for all modules given a router as context.

@param Router $router
495702
public function mapApiRoutes(Router $router)
    {
        foreach ($this->modules as $module) {
            $module->mapApiRoutes($router);
        }
    }
468775
public function boot(Router $router)
    {
        /** @var Application $app */
        $app = $this->app;

        $this->commands($this->commands);

        if (!$app->routesAreCached()) {
            $this->loadRoutes($router);
        }

        $this->loadMigrations();

        $this->loadTranslations();

        $this->registerPublishes();
    }
925936
public function map(Router $router)
    {
        $this->app['events']->fire('routes.loading');

        foreach ($this->app['modules.loader']->getRegisteredModules() as $module) {
            $this->app->call([$module, 'loadRoutes'], [$router]);
        }

        $this->app['events']->fire('routes.loaded');
    }
169069
protected function buildRouter()
    {
        $routes = new RouteCollection();
        $context = new RequestContext();
        $router = new UrlMatcher($routes, $context);

        return($router);
    }
659734
public function boot(Router $router)
    {
        $this->defineRoutes($router);

        $this->loadViewsFrom(__DIR__.'/../resources/views', 'warden');
        $this->publishes([
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/warden'),
        ], 'views');
        $this->publishes([
            __DIR__.'/../config/config.php' => config_path('kregel/warden.php'),
        ], 'config');
    }
657009
public function map(Router $router)
    {
        $router->group($this->routeAttributes(), function(Router $router) {
            \Antares\Logger\Http\Routes\LoggerRoute::register($router);
        });
    }
1034634
function buildRoutes(router, apiOrBuilder) {
    // if it's a builder function, build it...
    let pathPrefix = null;
    let api = null;
    let registry = null;
    let instanceName = null;
    if (_.isObject(apiOrBuilder)) {
        pathPrefix = apiOrBuilder.path;
        api = apiOrBuilder.api;
        registry = apiOrBuilder.registry;
        instanceName = apiOrBuilder.instanceName;
    } else {
        api = apiOrBuilder;
    }

    if (_.isFunction(api)) {
        api = api();
    }

    if (!registry && _.isFunction(api.registry)) {
        registry = api.registry();
    }

    if (!registry) {
        // print errors here
        return;
    }

    _.forEach(registry, (value, key) => {
        if (_.isArray(value)) {
            _.forEach(value, item => buildRoute(router, api, key, item, pathPrefix, instanceName));
        } else {
            buildRoute(router, api, key, value, pathPrefix, instanceName);
        }
    });
}
452333
public function loadModules(Router $router) {
        $this->modules = require_once BASE_DIR . '/config/modules.php';

        foreach ($this->modules['modules'] as $module) {
            if (!file_exists(MODULES_DIR . '/' . $module . '/Config/routes.php')) {
                throw new \Exception(_message(ExceptionMessages::MODULE_NOT_FOUND, $module));
            }

            $routesClosure = require_once MODULES_DIR . '/' . $module . '/Config/routes.php';

            if (!$routesClosure instanceof \Closure) {
                throw new \Exception(ExceptionMessages::ROUTES_NOT_CLOSURE);
            }

            $route = new Route($module);
            $routesClosure($route);
            $router->routes = $route->getRuntimeRoutes();
        }
    }
898660
public function boot(Router $router)
    {
        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__.'/../database/migrations' => database_path('migrations'),
            ], 'migrations');

            $this->publishes([
                __DIR__.'/../database/seeds' => database_path('seeds'),
            ], 'seeds');

            $this->publishes([
                __DIR__.'/../config/multisite.php' => config_path('multisite.php'),
            ], 'config');
        }

        $this->registerMiddleware($router);

        $this->registerComposers();
    }
1048825
public static function adminRoutes(\Illuminate\Routing\Router $router)
    {

        $router->group(['prefix' => 'translations'], function (\Illuminate\Routing\Router $router) {

            $router->get('/export', [
                'as'   => 'translations.export',
                'uses' => TranslationsController::class . '@export'
            ]);

            $router->post('/import', [
                'as'   => 'translations.import',
                'uses' => TranslationsController::class . '@import'
            ]);

            $router->post('/edit/{group}', [
                'as'   => 'translations.edit',
                'uses' => TranslationsController::class . '@edit'
            ]);

            $router->get('/manual', [
                'as'   => 'translations.manual',
                'uses' => TranslationsController::class . '@manual'
            ]);

            $router->post('/store', [
                'as'   => 'translations.store',
                'uses' => TranslationsController::class . '@storeTranslation'
            ]);

            $router->get('/{group?}', [
                'as'   => 'translations.index',
                'uses' => TranslationsController::class . '@index'
            ]);
        });

        $router->resources([
            'languages' => LanguagesController::class
        ]);
    }
223592
public function build() : RouterInterface
    {
        $router = $this->router;
        try{
            foreach($this->modules as $module)
            {
                $module->install($router);
            }
        }
        catch(\Throwable $e)
        {
            throw new RouterBuildingException($e);
        }
        return $router;
    }
1046453
public function boot(Router $router)
    {
        $this->publishAssets();
        $this->registerRoutes($router);
        $this->loadViewsFrom(__DIR__.'/Resources/views', 'beanstalkdui');
        $this->registerViewComposer();
    }
229362
public function addRouter(Router $router, int $priority = null)
	{
		if ($priority !== null) {
			Arrays::slice($this->indexedRouters, $priority, $router);
		} else {
			$this->routers[] = $router;
		}
	}
1099083
public function setRoutes (Router $router)
    {
        // Filter
        $router->addFilter ('authenticated', array ($this, 'routerVerifier'));

        // Routes
        $router->match ('GET|POST', $this->routepath . '/login/{authenticator}', '\CatLab\Accounts\Controllers\LoginController@authenticator');
        $router->match ('GET', $this->routepath . '/login', '\CatLab\Accounts\Controllers\LoginController@login');
        $router->match ('GET', $this->routepath . '/welcome', '\CatLab\Accounts\Controllers\LoginController@welcome')->filter('authenticated');

        $router->match ('GET|POST', $this->routepath . '/notverified', '\CatLab\Accounts\Controllers\LoginController@requiresVerification');

        $router->match ('GET', $this->routepath . '/logout', '\CatLab\Accounts\Controllers\LoginController@logout');

        $router->match ('GET', $this->routepath . '/cancel', '\CatLab\Accounts\Controllers\LoginController@cancel');

        $router->match ('GET|POST', $this->routepath . '/register/{authenticator}', '\CatLab\Accounts\Controllers\RegistrationController@authenticator');
        $router->match ('GET|POST', $this->routepath . '/register', '\CatLab\Accounts\Controllers\RegistrationController@register');

        $router->get ($this->routepath . '/verify/{id}', '\CatLab\Accounts\Controllers\LoginController@verify');
    }
572645
public function mapApiRoutes(Router $router)
    {
        $permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug(
            $this->getModelSlug()
        );

        $router->group(
            [
                'prefix'     => $this->getRoutePrefix(),
                'as'         => $this->getRouteNamePrefix(),
                'middleware' => [ cms_mw_permission("{$permissionPrefix}*") ],
            ],
            function (Router $router) use ($permissionPrefix) {

                $controller = $this->getModelApiController();

                $router->get('/', [
                    'as'   => 'index',
                    'uses' => $controller . '@index',
                ]);

                $router->get('create', [
                    'as'         => 'create',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}create")],
                    'uses'       => $controller . '@create',
                ]);

                $router->post('/', [
                    'as'         => 'store',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}create")],
                    'uses'       => $controller . '@store',
                ]);

                $router->get('{key}', [
                    'as'   => 'show',
                    'uses' => $controller . '@show',
                ]);

                $router->get('{key}/edit', [
                    'as'         => 'edit',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@edit',
                ]);

                $router->put('{key}', [
                    'as'         => 'update',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@update',
                ]);

                $router->delete('{key}', [
                    'as'         => 'destroy',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@destroy',
                ]);
            }
        );
    }
1056741
public function map(Router $router)
    {
        if ($this->isEnabled()) {
            $router->group($this->routeAttributes(), function() {
                Routes\RouteViewerRoutes::register();
            });
        }
    }
1045745
public function boot(Router $router)
  {
    $router->middleware('roles', \App\Http\Middleware\HasRole::class);
    $router->middleware('admin', \App\Http\Middleware\AdminMiddleware::class);
    if (! $this->app->routesAreCached()) {
      require __DIR__.'/Http/routes.php';
    }

    $configFiles = ['acl'];
    foreach ($configFiles as $config) {
      $this->mergeConfigFrom(__DIR__."/config/{$config}.php", 'acl');
    }

    $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'acl');
    $this->loadViewsFrom(__DIR__ . '/resources/views', 'acl');

    //Publish middleware
    $this->publishes([
      __DIR__ . '/Middleware/' => app_path('Http/Middleware'),
    ]);

    //Publish providers
    $this->publishes([
      __DIR__ . '/Providers/' => app_path('Providers'),
    ]);

    //Publish views
    $this->publishes([
      // __DIR__.'/resources/views' => resource_path('views/vendor/user-auth'),
      __DIR__.'/resources/views' => resource_path('views'),
    ], 'views');

    //Publish translations
    $this->publishes([
      __DIR__.'/resources/lang/' => resource_path('lang/'),
      // __DIR__.'/resources/lang/pagination.php' => resource_path('lang/pagination.php'),
      // __DIR__.'/resources/lang/password.php' => resource_path('lang/password.php'),
      // __DIR__.'/resources/lang/validation.php' => resource_path('lang/validation.php'),
    ], 'translations');

    // Publish a config file
    $this->publishes([
      __DIR__.'/config/acl.php' => config_path('acl.php'),
    ], 'config');

    //Publish migrations
    $this->publishes([
      __DIR__ . '/database/migrations' => database_path('migrations'),
      __DIR__ . '/database/seeds' => database_path('seeds'),
    ], 'migrations');

    $this->publishes([
      __DIR__.'/assets/bower_components/AdminLTE/' => public_path('/assets/bower_components/AdminLTE/'),
    ], 'public');

    $this->publishes([
      __DIR__ . '/Http/Controllers/Auth/'    => app_path('/Http/Controllers/Auth/'),
      __DIR__ . '/Http/Controllers/Admin/'    => app_path('/Http/Controllers/Admin/'),
    ], 'controllers');
    $this->publishes([
      __DIR__ . '/Models/Admin/' => app_path(),
    ], 'models');
  }