+ // Create a new comment.
+ $this->checkPermission('comment-create-all');
+ $comment = $this->commentRepo->create($page, $request->only(['html', 'text', 'parent_id']));
+ Activity::add($page, 'commented_on', $page->book->id);
+ return view('comments/comment', ['comment' => $comment]);
+ }
+
+ /**
+ * Update an existing comment.
+ * @param Request $request
+ * @param integer $commentId
+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ */
+ public function update(Request $request, $commentId)
+ {
+ $this->validate($request, [
+ 'text' => 'required|string',
+ 'html' => 'required|string',