Register middleware.

@param  object $router
@return void
497776
protected function registerMiddleware($router)
    {
        if (method_exists($router, 'aliasMiddleware')) {
            $router->aliasMiddleware('site', CurrentSite::class);
        } else {
            $router->middleware('site', CurrentSite::class);
        }
    }
45953
public function setRouter(Router $router)
    {
        $this->router = $router;
        $this->router->setContext($this->context);
        $this->context->registerInstance($router);
    }
703231
public function map(Router $router)
    {
        $router->group($this->routeAttributes(), function(Router $router) {
            LogViewerRoute::register($router);
        });
    }
629313
protected function registerCmsWebGroupMiddleware()
    {
        $this->router->middlewareGroup($this->getConfiguredWebGroupName(), []);

        foreach ($this->getGlobalWebMiddleware() as $middleware) {

            // Don't add if the middleware is already globally enabled in the kernel
            if ($this->kernel->hasMiddleware($middleware)) {
                // @codeCoverageIgnoreStart
                continue;
                // @codeCoverageIgnoreEnd
            }

            $this->router->pushMiddlewareToGroup($this->getConfiguredWebGroupName(), $middleware);
        }

        return $this;
    }
221299
protected function registerMiddleware() {
    $middleware = $this->app['config']['app.middleware'];

    foreach ($middleware as $class_name) {
      $filter = app($class_name);
      if ($filter instanceof BeforeInterface) {
        array_push($this->before, $filter);
      }
      if ($filter instanceof AfterInterface) {
        array_push($this->after, $filter);
      }
    }
  }
518430
public function boot(Router $router)
	{
        $attributes = [
            'prefix'     => config('lia.route.prefix').'/trans',
            'namespace'  => 'Lia\Addons\TranslationManager',
            'middleware' => ['api', 'jwt.auth'],
            'as'         => 'trans.'
        ];

        $router->group($attributes, function($router)
        {
            $router->get('/{groupKey?}', 'Controller@getIndex')->where('groupKey', '.*')->name('getIndex');
            $router->post('/add/{groupKey}', 'Controller@postAdd')->where('groupKey', '.*')->name('postAdd');
            $router->post('/edit/{groupKey}', 'Controller@postEdit')->where('groupKey', '.*')->name('postEdit');
            $router->post('/groups/add', 'Controller@postAddGroup')->name('postAddGroup');
            $router->post('/delete/{groupKey}/{translationKey}', 'Controller@postDelete')->where('groupKey', '.*')->name('postDelete');
            $router->post('/import', 'Controller@postImport')->name('postImport');
            $router->post('/find', 'Controller@postFind')->name('postFind');
            $router->post('/locales/add', 'Controller@postAddLocale')->name('postAddLocale');
            $router->post('/locales/remove', 'Controller@postRemoveLocale')->name('postRemoveLocale');
            $router->post('/publish/{groupKey}', 'Controller@postPublish')->where('groupKey', '.*')->name('postPublish');
        });
	}
937799
protected function registerRoutes()
    {
        $this->app['router']->group([
            'middleware' => config('bone.captcha.middleware', 'web'),
            'namespace'  => 'Igoshev\Captcha\Controllers',
            'as'         => 'bone.captcha.'
        ], function ($router) {
            $router->get(config('bone.captcha.routes.image'), 'CaptchaController@image')->name('image');
            $router->get(config('bone.captcha.routes.image_tag'), 'CaptchaController@imageTag')->name('image.tag');
        });
    }
965296
protected function registerMiddleware($middleware)
    {
        /** @var Kernel $kernel */
        $kernel = $this->getContainer()->get(KernelInterface::class);
        $kernel->prependMiddleware($middleware);
    }
978879
public function register()
  {
    $middleware = ($this->middleware !== null) ? ['middleware' => $this->middleware] : [];
    $prefix     = ($this->prefix !== null) ? ['prefix' => $this->prefix] : [];
    $domain     = ($this->domain !== null) ? ['domain' => $this->domain] : [];

    Swish::group(array_merge($domain, $middleware, $prefix), function() {
      startphp($this->file);
    });
  }
1088174
public function register()
    {
        $this->app['router']->aliasMiddleware('admin', \PhilMareu\Laramanager\Http\Middleware\AdminMiddleware::class);
        $this->app['router']->aliasMiddleware('guest.admin', \PhilMareu\Laramanager\Http\Middleware\RedirectIfAuthenticated::class);

        $this->mergeConfigFrom(__DIR__.'/../../../config/imagecache/templates.php', 'imagecache.templates');
        $this->mergeConfigFrom(__DIR__.'/../../../config/imagecache/paths.php', 'imagecache.paths');
        config(['imagecache.route' => 'images']);
    }
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();
    }
722394
public function boot(Router $router, Kernel $kernel)
    {
        $this->registerRouteFilters($router);

        $this->registerRouteMiddleware($router, $kernel);
    }
1336510
public function registerMiddleware()
    {
        if (is_array($this->middleware()) && count($this->middleware()))
        {
            $middleware = new Middleware($this);
            return $middleware->add();
        }
        return true;
    }
749583
protected function registerRoutes()
    {
        $router = $this->app['FluxBB\Web\Router'];

        $this->registerFrontendRoutes($router);
        $this->registerApiRoutes($router);
    }
563020
protected function registerMiddlewares()
    {
        // Init middlewares
        $middlewares = (array) $this->config->get('middlewares', []);

        foreach ($middlewares as $k => $middleware) {
            $this->addMiddleware($middleware, is_numeric($k) ? $k : PriorityQueue::NORMAL);
        }

        // Remove closures
        $this->config->set('middlewares', null);
    }
882183
function Router() {
  var self = this;
  this._routes = {};

  this.middleware = function(req, res, next) {
    self._dispatch(req, res, next);
  };
}
1231982
public function boot(\Illuminate\Routing\Router $router)
    {
        if (!$this->app->routesAreCached()) {
            require __DIR__.'/Routes/web.php';
        }

        $this->publishes([
            __DIR__.'/Config/localizer.php' => config_path('localizer.php'),
        ], 'localizer_config');

        $this->publishes([
            __DIR__.'/Config/localizer_languages.php' => config_path('localizer_languages.php'),
        ], 'localizer_languages');

        $router->aliasMiddleware('localizer', config('localizer.middleware'));
        $this->app->register(IdentifyServiceProvider::class);

        $this->publishes([
                __DIR__.'/Migrations/2016_11_28_115831_add_locale_column.php' => $this->app->databasePath().'/migrations/'.date('Y_m_d_His', time()).'_add_locale_column.php',
        ], 'localizer_migrations');

        if (!config('localizer.dynamic_migration_name')) {
            $this->loadMigrationsFrom(__DIR__.'/Migrations', 'localizer');
        }
    }