+ public function update(Request $request, $bookSlug, $chapterSlug)
+ {
+ $this->checkPermission('chapter-update');
+ $book = $this->bookRepo->getBySlug($bookSlug);
+ $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
+ $chapter->fill($request->all());
+ $chapter->slug = $this->chapterRepo->findSuitableSlug($chapter->name, $book->id, $chapter->id);
+ $chapter->updated_by = Auth::user()->id;
+ $chapter->save();
+ Activity::add($chapter, 'chapter_update', $book->id);
+ return redirect($chapter->getUrl());
+ }
+
+ /**
+ * Shows the page to confirm deletion of this chapter.
+ * @param $bookSlug
+ * @param $chapterSlug
+ * @return \Illuminate\View\View
+ */
+ public function showDelete($bookSlug, $chapterSlug)