/** * Register the service provider. * * @return void */ public function register() { parent::register(); $kernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel'); $this->app->instance('app.middleware', $this->gatherAppMiddleware($kernel)); $this->addRequestMiddlewareToBeginning($kernel); $this->app->singleton('api.router.adapter', function ($app) { return new LaravelAdapter($app['router']); }); }
/** * Register the service provider. * * @return void */ public function register() { parent::register(); $reflection = new ReflectionClass($this->app); $this->app->instance('app.middleware', $this->gatherAppMiddleware($reflection)); $this->addRequestMiddlewareToBeginning($reflection); $this->app->singleton('api.router.adapter', function ($app) { return new LumenAdapter($app, new StdRouteParser(), new GcbDataGenerator(), 'FastRoute\\Dispatcher\\GroupCountBased'); }); }