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