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

boot() public method

Boot the service provider.
public boot ( ) : void
return void
    public function boot()
    {
        $this->setResponseStaticInstances();
        Request::setAcceptParser($this->app['Dingo\\Api\\Http\\Parser\\Accept']);
        $this->app->rebinding('api.routes', function ($app, $routes) {
            $app['api.url']->setRouteCollections($routes);
        });
    }

Usage Example

Esempio n. 1
0
 /**
  * Boot the service provider.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     $this->publishes([realpath(__DIR__ . '/../../config/api.php') => config_path('api.php')]);
     $kernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel');
     $this->app['Dingo\\Api\\Http\\Middleware\\Request']->mergeMiddlewares($this->gatherAppMiddleware($kernel));
     $this->addRequestMiddlewareToBeginning($kernel);
     $this->app['events']->listen(RequestWasMatched::class, function (RequestWasMatched $event) {
         $this->replaceRouteDispatcher();
         $this->updateRouterBindings();
     });
 }
All Usage Examples Of Dingo\Api\Provider\DingoServiceProvider::boot