]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Models/Chapter.php
Applied another round of static analysis updates
[bookstack] / app / Entities / Models / Chapter.php
index 224ded935048ef86e581376ca1bd380c43a4787e..8fc2d333dbe43a99321414fb983b185070071c46 100644 (file)
@@ -23,6 +23,7 @@ class Chapter extends BookChild
 
     /**
      * Get the pages that this chapter contains.
+     * @return HasMany<Page>
      */
     public function pages(string $dir = 'ASC'): HasMany
     {
@@ -50,7 +51,8 @@ class Chapter extends BookChild
      */
     public function getVisiblePages(): Collection
     {
-        return $this->pages()->visible()
+        return $this->pages()
+        ->scopes('visible')
         ->orderBy('draft', 'desc')
         ->orderBy('priority', 'asc')
         ->get();