+ // 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.
+ * @throws ValidationException
+ */
+ public function update(Request $request, int $commentId)
+ {
+ $this->validate($request, [
+ 'text' => 'required|string',
+ 'html' => 'required|string',