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

destroy() public method

Remove the specified book from storage.
public destroy ( $bookSlug ) : Response
$bookSlug
return Response
    public function destroy($bookSlug)
    {
        $book = $this->bookRepo->getBySlug($bookSlug);
        $this->checkOwnablePermission('book-delete', $book);
        Activity::addMessage('book_delete', 0, $book->name);
        Activity::removeEntity($book);
        $this->bookRepo->destroy($book);
        return redirect('/books');
    }