belongsTo(User::class, 'user_id'); } public function recipe_comment() { return $this->belongsTo(BlogPostComment::class, 'recipe_comment_id'); } public function scopeForRecipeCommentsUpVote($query, RecipeComment $comment) { return $query->where('recipe_comment_id', $comment->id)->where('type', 'upvote'); } public function scopeForRecipeCommentsDownVote($query, RecipeComment $comment) { return $query->where('recipe_comment_id', $comment->id)->where('type', 'downvote'); } }