BookStack\Repos\ChapterRepo::getBySlug PHP Method

getBySlug() public method

Get a chapter that has the given slug within the given book.
public getBySlug ( $slug, $bookId ) : mixed
$slug
$bookId
return mixed
    public function getBySlug($slug, $bookId)
    {
        $chapter = $this->chapterQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
        if ($chapter === null) {
            throw new NotFoundException('Chapter not found');
        }
        return $chapter;
    }