setEventDispatcher() public static method

Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void
$events Illuminate\Events\Dispatcher
return void
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);
     });
 }
 /**
  * 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);
     });
 }
Example #4
0
 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());
 }