public function setPostsCountCache() { $this->topic_replies = -1 + $this->posts()->where('post_approved', true)->count(); $this->topic_replies_real = -1 + $this->posts()->count(); }