protected function dispatchToRouter() { $this->router = $this->app['router']; $this->registerMiddlewareGroups(); $this->registerMiddleware(); return parent::dispatchToRouter(); }