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; }