Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $data = Input::except(array('_token'));
     $rule = array('comment_id' => 'required|exists:comments,id', 'comment' => 'required');
     $validator = Validator::make($data, $rule);
     if ($validator->fails()) {
         /*return Redirect::to('comments')
           ->withErrors($validator->messages());*/
         return 'false';
     } else {
         Update::saveFormData(array("time" => time()));
         Notes::saveFormData(Input::except(array('_token')));
         /*return Redirect::to('comments')
           ->withMessage('success');*/
         return 'true';
     }
 }