没有重写 notify 这样做行吗?
App\Observers\ReplyObserver
public function created(Reply $reply)
{
$reply->topic->reply_count = $reply->topic->replies->count();
$reply->topic->save();
if (Auth::id() != $reply->topic->user_id) {
$reply->topic->user->notify(new TopicReplied($reply));
$reply->topic->user->increment('notification_count');
}
}
这样行不行。不想改notify了。合不合适