Closed kaysonwu closed 6 years ago
在 AppServiceProvider 的 boot 方法中注册观察者,这是一种浪费 IO 的表现。如果我有多个 观察者但我并不需要使用它,这很容易给初学者带来困惑,所以我增加了一个在模型里的 boot 方法中注册观察者
AppServiceProvider
boot
个人更建议你在社区分享这个见解😄
在
AppServiceProvider
的boot
方法中注册观察者,这是一种浪费 IO 的表现。如果我有多个 观察者但我并不需要使用它,这很容易给初学者带来困惑,所以我增加了一个在模型里的boot
方法中注册观察者