示例#1
0
 /**
  * Bootstrap any application services.
  */
 public function boot()
 {
     Trick::observe(TrickObserver::class);
 }
示例#2
0
 /**
  * Increment the view count on the given trick.
  *
  * @param \App\Trick $trick
  *
  * @return \App\Trick
  */
 public function incrementViews(Trick $trick)
 {
     $trick->view_cache = $trick->view_cache + 1;
     $trick->save();
     return $trick;
 }