Made shelf listing more unique & efficient

- Now includes listing of all books within.
This commit is contained in:
Dan Brown
2019-02-16 17:13:01 +00:00
parent e9be2b7174
commit f1e571a57c
9 changed files with 75 additions and 13 deletions

View File

@ -47,7 +47,9 @@ class BookshelfController extends Controller
'updated_at' => trans('common.sort_updated_at'),
];
$shelves = $this->entityRepo->getAllPaginated('bookshelf', 18, $sort, $order);
$shelves = $this->entityRepo->getAllPaginated('bookshelf', 18, $sort, $order, function($query) {
$query->with(['books']);
});
$recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('bookshelf', 4, 0) : false;
$popular = $this->entityRepo->getPopular('bookshelf', 4, 0);
$new = $this->entityRepo->getRecentlyCreated('bookshelf', 4, 0);