/**
  * Bootstrap any application services.
  */
 public function boot()
 {
     Trick::observe(TrickObserver::class);
 }
Beispiel #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;
 }