コード例 #1
0
 /**
  * We have a number of observers that immediately update related data when certain
  * actions occur, such as the number of comments on a discussion, or who last updated
  * or contributed to a category in some way.
  */
 public function boot()
 {
     $countCacheObserver = $this->app->make(CountCacheObserver::class);
     $updatedByObserver = new UpdatedByObserver();
     Comment::observe($countCacheObserver);
     Comment::observe($updatedByObserver);
     Discussion::observe($countCacheObserver);
     Discussion::observe($updatedByObserver);
 }