/**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     \App\Post::observe(new Post());
     \App\Post::observe(new PostCacheObserver());
 }
コード例 #2
0
 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     Post::observe(new PostObserver());
     parent::boot($events);
 }