public function post($id, $content) { $validator = new Validation(); $validator->setRule('required', $content); if (!$validator->validate()) { Session::setError($validator->getErrors()); Redirect::back(); } if ($this->comment->add(Auth::getUserId(), $id, $content) !== 1) { Session::setError('something went wrong'); Redirect::back(); } Session::setMessage('Done'); Redirect::to('/product/' . $id); }