BookStack\Http\Controllers\ChapterController::destroy PHP Method

destroy() public method

Remove the specified chapter from storage.
public destroy ( $bookSlug, $chapterSlug ) : Response
$bookSlug
$chapterSlug
return Response
    public function destroy($bookSlug, $chapterSlug)
    {
        $book = $this->bookRepo->getBySlug($bookSlug);
        $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
        $this->checkOwnablePermission('chapter-delete', $chapter);
        Activity::addMessage('chapter_delete', $book->id, $chapter->name);
        $this->chapterRepo->destroy($chapter);
        return redirect($book->getUrl());
    }