/**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher $events
  *
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     // register custom model observers
     Product::observe(new ProductObserver(new ImageProcessor()));
     Brand::observe(new ProductBrandObserver(new ImageProcessor()));
     User::observe(new UserObserver(new ImageProcessor()));
 }
Exemplo n.º 2
0
 /**
  * boot
  * observing model
  *
  */
 public static function boot()
 {
     parent::boot();
     Product::observe(new ProductObserver());
 }