X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/141eecb858cce126452baeb16905e25b6ceb13c6..refs/pull/4430/head:/app/Entities/Controllers/BookshelfController.php diff --git a/app/Entities/Controllers/BookshelfController.php b/app/Entities/Controllers/BookshelfController.php index d1b752dc2..fcfd37538 100644 --- a/app/Entities/Controllers/BookshelfController.php +++ b/app/Entities/Controllers/BookshelfController.php @@ -30,7 +30,7 @@ class BookshelfController extends Controller } /** - * Display a listing of the book. + * Display a listing of bookshelves. */ public function index(Request $request) { @@ -111,8 +111,9 @@ class BookshelfController extends Controller ]); $sort = $listOptions->getSort(); - $sortedVisibleShelfBooks = $shelf->visibleBooks()->get() - ->sortBy($sort === 'default' ? 'pivot.order' : $sort, SORT_REGULAR, $listOptions->getOrder() === 'desc') + $sortedVisibleShelfBooks = $shelf->visibleBooks() + ->reorder($sort === 'default' ? 'order' : $sort, $listOptions->getOrder()) + ->get() ->values() ->all();