Пример #1
0
 public function post_answer()
 {
     $answer_content = Input::get('ans_content');
     // OK
     $question_id = Input::get('question_id');
     // OK
     $user_id = Input::get('user_id');
     // OK
     if (!empty($answer_content)) {
         $answer = new Answers();
         $is_answer_posted = $answer->post_answer($user_id, $question_id, $answer_content);
         if ($is_answer_posted) {
             return redirect("user/listing");
         }
     } else {
         $message = "Your answer is empty, try again with answer";
         return view('welcome')->withMessage($message);
     }
 }