1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Queries: Extracted static page,chapter,shelf queries to classes

This commit is contained in:
Dan Brown
2024-02-07 21:58:27 +00:00
parent 483410749b
commit 546cfb0dcc
15 changed files with 93 additions and 60 deletions

View File

@ -359,7 +359,9 @@ class PageController extends Controller
$query->scopes('visible');
};
$pages = Page::visible()->with(['updatedBy', 'book' => $visibleBelongsScope, 'chapter' => $visibleBelongsScope])
$pages = $this->queries->visibleForList()
->addSelect('updated_by')
->with(['updatedBy', 'book' => $visibleBelongsScope, 'chapter' => $visibleBelongsScope])
->orderBy('updated_at', 'desc')
->paginate(20)
->setPath(url('/pages/recently-updated'));