Wrap the routes in the basic middleware.

@param \Illuminate\Routing\Router $router
@param object                     $routes
@param bool                       $applyAlwaysAuthenticate

@return void
171818
protected function mapOtherwise(Router $router, $routes, $applyAlwaysAuthenticate)
    {
        $middleware = [
            SubstituteBindings::class,
            Acceptable::class,
            Timezone::class,
        ];

        if ($applyAlwaysAuthenticate && !$this->isWhiteListedAuthRoute($routes)) {
            $middleware[] = 'auth.api:true';
        }

        $router->group(['middleware' => $middleware], function (Router $router) use ($routes) {
            $routes->map($router);
        });
    }
1297958
public function addRoutes(array $routes = [])
    {
        foreach($routes as $route)
        {
            if ($route instanceof RouteInterface) $this->routes[] = $route;
        }
    }
931924
protected function checkRequiredRoutesValidity(array $routes, array $requiredRouteKeys): void
    {
        $routeKeys = array_keys($routes);
        foreach ($requiredRouteKeys as $requiredRouteKey) {
            if (! in_array($requiredRouteKey, $routeKeys)) {
                throw new ErrorException(
                    'The required « ' . $requiredRouteKey
                    . ' » route key is missing. Use the « setRoutes() » method to declare it.'
                );
            }
        }
    }
76132
public function processRoute(Route $route, array $rulesToApply = [])
    {
        $routeAction = $route->getAction();
        list($class, $method) = explode('@', $routeAction['uses']);
        $controller = new ReflectionClass($class);
        $method = $controller->getMethod($method);

        $routeGroup = $this->getRouteGroup($controller, $method);
        $docBlock = $this->parseDocBlock($method);
        $bodyParameters = $this->getBodyParameters($method, $docBlock['tags']);
        $queryParameters = $this->getQueryParameters($method, $docBlock['tags']);
        $content = ResponseResolver::getResponse($route, $docBlock['tags'], [
            'rules' => $rulesToApply,
            'body' => $bodyParameters,
            'query' => $queryParameters,
        ]);

        $parsedRoute = [
            'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
            'group' => $routeGroup,
            'title' => $docBlock['short'],
            'description' => $docBlock['long'],
            'methods' => $this->getMethods($route),
            'uri' => $this->getUri($route),
            'boundUri' => Utils::getFullUrl($route, $rulesToApply['bindings'] ?? []),
            'queryParameters' => $queryParameters,
            'bodyParameters' => $bodyParameters,
            'cleanBodyParameters' => $this->cleanParams($bodyParameters),
            'cleanQueryParameters' => $this->cleanParams($queryParameters),
            'authenticated' => $this->getAuthStatusFromDocBlock($docBlock['tags']),
            'response' => $content,
            'showresponse' => ! empty($content),
        ];
        $parsedRoute['headers'] = $rulesToApply['headers'] ?? [];

        return $parsedRoute;
    }
466729
public function mapWebRoutes(Router $router)
    {
        foreach ($this->modules as $module) {
            $module->mapWebRoutes($router);
        }
    }
1146268
public function addRoute(Route $route) {

	    $id = $route->getRouteId();

	    if(array_key_exists($id, $this->routes)) {

	        throw new \InvalidArgumentException(sprintf("Route with id '%s' already exists.", $id));
        }

        $this->routes[$id] = $route;

    }
876134
public function addRoutes($routes = array())
    {
        if (!$this->isRegistered()) {
            $this->registerWordpressAction();
        }

        $this->route->addPossibilities($routes);
    }
1313650
public function setRoutes( RouteCollection $routes )
	{
		foreach ( $routes as $route )
			$route->setRouter( $this );

		$this->routes = $routes;
	}
606956
public function addRoutes($routes)
    {
        if (!is_array($routes)) {
            throw new \InvalidArgumentException("Routes must be an array");
        }

        $routes = array_filter($routes, function ($route) {
            return is_a('Route', $route);
        });

        $this->routes = array_merge($this->routes, $routes);
    }
657009
public function map(Router $router)
    {
        $router->group($this->routeAttributes(), function(Router $router) {
            \Antares\Logger\Http\Routes\LoggerRoute::register($router);
        });
    }
708555
private static function prepareMiddleware(IlluminateRoute $route)
    {
        return array_map(function ($value) {
            return $value instanceof \Closure ? 'Closure' : $value;
        }, self::gatherMiddleware($route));
    }
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');
  }
582388
protected function overrideMiddleware(Router $router): void
    {
        // Append middleware to the 'web' middlware group
        $router->pushMiddlewareToGroup('web', UpdateLastActivity::class);

        // Override route middleware on the fly
        $router->aliasMiddleware('reauthenticate', Reauthenticate::class);
        $router->aliasMiddleware('guest', RedirectIfAuthenticated::class);
    }
970021
protected function registerRoutes(array $routes)
    {
        foreach ($routes as $route => $config) {
            $this->registerRoute($route, $config);
        }
    }
1147959
protected function registerRoutes (Router $router)
    {
        $filePath = $this->homeDirectory . '/../../app/honeycomb/routes.php';

        if( file_exists($filePath) ) {
            if (! $this->app->routesAreCached()) {
                $router->group([
                    'namespace'  => $this->namespace,
                ], function (Router $router) use ($filePath) {
                    require $filePath;
                });
            }
        }
    }
662403
public function registerRawRouting(array $routes, PackageResolver $resolver)
    {
        foreach ($routes as $key => &$route) {
            // Package
            if (isset($route['package'])) {
                if (!isset($route['pattern'])) {
                    throw new \InvalidArgumentException(sprintf('Route need pattern: %s', print_r($route, true)));
                }

                if (!$resolver->exists($route['package'])) {
                    throw new \InvalidArgumentException(sprintf(
                        'Package %s not exists when register routing: %s.',
                        $route['package'],
                        $key
                    ));
                }

                $package = $resolver->getPackage($route['package']);

                $package->loadRouting($this, $route['pattern']);

                continue;
            }

            // Simple route
            $this->addRouteByConfig($key, $route);
        }

        return $this;
    }
1091320
public function map(Router $router)
    {
        $router->group(['namespace' => $this->namespace], function (Router $router) {
            /*
             * Admin routes
             */
            $router->resource('admin/menus.menulinks', 'AdminController');
            $router->post(
                'admin/menulinks/sort',
                ['as' => 'admin.menulinks.sort', 'uses' => 'AdminController@sort']
            );

            /*
             * API routes
             */
            $router->resource('api/menulinks', 'ApiController');
        });
    }