Ejemplo n.º 1
0
 /**
  * Register the listeners for the subscriber.
  *
  * @param \Illuminate\Events\Dispatcher $events
  */
 public function subscribe($events)
 {
     $events->listen(eloquent_event(Topic::class, Event::SAVING), class_callback(self::class, 'onSaving'));
 }
Ejemplo n.º 2
0
 /**
  * 注册监听器给订阅者。.
  *
  * @param \Illuminate\Events\Dispatcher $events
  */
 public function subscribe($events)
 {
     $events->listen(TopicUpVoted::class, class_callback(self::class, 'handle'));
     $events->listen(NewReply::class, class_callback(self::class, 'handle'));
 }