X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/06b500984250f75b98f38a8f25ac953cb45aeee4..refs/pull/3850/head:/app/Http/Controllers/Api/ChapterApiController.php diff --git a/app/Http/Controllers/Api/ChapterApiController.php b/app/Http/Controllers/Api/ChapterApiController.php index 6b226b5f0..8459b8449 100644 --- a/app/Http/Controllers/Api/ChapterApiController.php +++ b/app/Http/Controllers/Api/ChapterApiController.php @@ -70,7 +70,7 @@ class ChapterApiController extends ApiController public function read(string $id) { $chapter = Chapter::visible()->with(['tags', 'createdBy', 'updatedBy', 'ownedBy', 'pages' => function (HasMany $query) { - $query->visible()->get(['id', 'name', 'slug']); + $query->scopes('visible')->get(['id', 'name', 'slug']); }])->findOrFail($id); return response()->json($chapter);