$answer,'question_id'=>$question_id,'user_id'=>$user_id]); } public static function upvote_answer($answer_id,$user_id) { return Upvote::create(['answer_id'=>$answer_id,'user_id'=>$user_id]); } public static function update_answer($answer_id,$new_answer) { $answer = Answer::find($answer_id); $answer->answer = $new_answer; return $answer->save(); } }