App\Listeners\Forum\NotifyEmail::markViewed PHP Method

markViewed() public method

public markViewed ( $event )
    public function markViewed($event)
    {
        if ($event->user === null) {
            return;
        }
        $user = $event->user->fresh();
        $topic = $event->topic->fresh();
        $post = $event->post->fresh();
        if ($topic->topic_last_post_time > $post->post_time) {
            return;
        }
        TopicWatch::where(['topic_id' => $topic->topic_id, 'user_id' => $user->user_id])->update(['notify_status' => false]);
    }