belongsTo(User::class, 'user_id'); } public function blog_post_comment() { return $this->belongsTo(BlogPostComment::class, 'blog_post_comment_id'); } public function scopeForBlogPostCommentsUpVote($query, BlogPostComment $comment) { return $query->where('blog_post_comment_id', $comment->id)->where('type', 'upvote'); } public function scopeForBlogPostCommentsDownVote($query, BlogPostComment $comment) { return $query->where('blog_post_comment_id', $comment->id)->where('type', 'downvote'); } }