$question,'user_id'=>$user_id]); } public static function get_questions_with_answers() { return Question::with('Answers')->get()->toArray(); } public static function get_questions_with_users() { return Question::with('user')->get()->toArray(); } public static function get_question_answers_upvotes($question_id) { return Question::find($question_id)->answers()->with('upvotes')->get()->toArray(); } }