Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void | ||
$events | Illuminate\Events\Dispatcher | |
return | void |
/** * 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); }); }
/** * 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']); $config = $this->app['config']['api']; Http\Request::setAcceptParser(new Http\Parser\Accept($config['standardsTree'], $config['subtype'], $config['version'], $config['defaultFormat'])); $this->app->rebinding('api.routes', function ($app, $routes) { $app['api.url']->setRouteCollections($routes); }); }
/** * Boot the service provider. * * @return void */ public function boot() { $this->setupConfig(); $this->app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', function ($app) { return $app['api.exception']; }); 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); }); }
protected function setResponseStaticInstances() { Response::setFormatters($this->config('formats')); Response::setTransformer($this->app['api.transformer']); Response::setEventDispatcher($this->app['events']); }
public function setUp() { Response::setEventDispatcher($this->events = new EventDispatcher()); }