Dingo\Api\Provider\LaravelServiceProvider::boot PHP Method

boot() public method

Boot the service provider.
public boot ( ) : void
return void
    public function boot()
    {
        parent::boot();
        $this->publishes([realpath(__DIR__ . '/../../config/api.php') => config_path('api.php')]);
        $kernel = $this->app->make(Kernel::class);
        $this->app[Request::class]->mergeMiddlewares($this->gatherAppMiddleware($kernel));
        $this->addRequestMiddlewareToBeginning($kernel);
        $this->app['events']->listen(RequestWasMatched::class, function (RequestWasMatched $event) {
            $this->replaceRouteDispatcher();
            $this->updateRouterBindings();
        });
        $this->app['router']->middleware('api.auth', Auth::class);
        $this->app['router']->middleware('api.throttle', RateLimit::class);
        $this->app['router']->middleware('api.controllers', PrepareController::class);
    }