X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/00ae04e0bd7f9d80aa80334b8a8bb55e7ca33cad..06901b878f2c8057a6f9b7d2e0adfda425c68dee:/app/Entities/Controllers/ChapterApiController.php diff --git a/app/Entities/Controllers/ChapterApiController.php b/app/Entities/Controllers/ChapterApiController.php index c21323262..85c81c248 100644 --- a/app/Entities/Controllers/ChapterApiController.php +++ b/app/Entities/Controllers/ChapterApiController.php @@ -134,8 +134,9 @@ class ChapterApiController extends ApiController $chapter->unsetRelations()->refresh(); $chapter->load(['tags']); - $chapter->makeVisible('description_html') - ->setAttribute('description_html', $chapter->descriptionHtml()); + $chapter->makeVisible('description_html'); + $chapter->setAttribute('description_html', $chapter->descriptionHtml()); + $chapter->setAttribute('book_slug', $chapter->book()->first()->slug); return $chapter; }