protected function replaceRouteDispatcher() { $this->app->singleton('illuminate.route.dispatcher', function ($app) { return new ControllerDispatcher($app['api.router.adapter']->getRouter(), $app); }); }