Dingo\Api\Http\Response::setEventDispatcher PHP Method

setEventDispatcher() public static method

Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void
$events Illuminate\Events\Dispatcher
return void
    public static function setEventDispatcher(EventDispatcher $events)
    {
        static::$events = $events;
    }

Usage Example

Example #1
0
 /**
  * Boot the service provider.
  *
  * @return void
  */
 public function boot()
 {
     $this->setupConfig();
     Http\Response::setFormatters($this->prepareConfigValues($this->app['config']['api.formats']));
     Http\Response::setTransformer($this->app['api.transformer']);
     Http\Response::setEventDispatcher($this->app['events']);
     $this->app->rebinding('api.routes', function ($app, $routes) {
         $app['api.url']->setRouteCollections($routes);
     });
 }
All Usage Examples Of Dingo\Api\Http\Response::setEventDispatcher