BookStack\Repos\BookRepo::getBySlug PHP Method

getBySlug() public method

Get a book by slug
public getBySlug ( $slug ) : mixed
$slug
return mixed
    public function getBySlug($slug)
    {
        $book = $this->bookQuery()->where('slug', '=', $slug)->first();
        if ($book === null) {
            throw new NotFoundException('Book not found');
        }
        return $book;
    }