protected function registerRouteMiddleware()
    {
        // register route middleware.
        foreach ($this->routeMiddleware as $key => $middleware) {
            app('router')->aliasMiddleware($key, $middleware);
        }

        // register middleware group.
        foreach ($this->middlewareGroups as $key => $middleware) {
            app('router')->middlewareGroup($key, $middleware);
        }
    }
protected function registerRouteMiddleware()
    {
        // register route middleware.
        foreach ($this->routeMiddleware as $key => $middleware) {
            app('router')->aliasMiddleware($key, $middleware);
        }

        // register middleware group.
        foreach ($this->middlewareGroups as $key => $middleware) {
            app('router')->middlewareGroup($key, $middleware);
        }
    }
protected function registerRouteMiddleware ( ) { // register route middleware. foreach ( $ this -> routeMiddleware as $ key => $ middleware ) { app ( 'router' ) -> aliasMiddleware ( $ key , $ middleware ) ; } // register middleware group. foreach ( $ this -> middlewareGroups as $ key => $ middleware ) { app ( 'router' ) -> middlewareGroup ( $ key , $ middleware ) ; } }
Register the route middleware.

@return void
Register the route middleware .