1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Queries: Updated all app book static query uses

This commit is contained in:
Dan Brown
2024-02-07 16:37:36 +00:00
parent c95f4ca40f
commit 483410749b
37 changed files with 278 additions and 162 deletions

View File

@ -40,7 +40,7 @@ class HomeController extends Controller
$recentFactor = count($draftPages) > 0 ? 0.5 : 1;
$recents = $this->isSignedIn() ?
(new RecentlyViewed())->run(12 * $recentFactor, 1)
: Book::visible()->orderBy('created_at', 'desc')->take(12 * $recentFactor)->get();
: $this->queries->books->visibleForList()->orderBy('created_at', 'desc')->take(12 * $recentFactor)->get();
$favourites = (new TopFavourites())->run(6);
$recentlyUpdatedPages = $this->queries->pages->visibleForList()
->where('draft', false)