X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/b12ae6d11b18acee1107b8182e7e666be05e3337..refs/pull/1462/head:/app/Entities/Bookshelf.php diff --git a/app/Entities/Bookshelf.php b/app/Entities/Bookshelf.php index 08ce8d8cb..1de767fec 100644 --- a/app/Entities/Bookshelf.php +++ b/app/Entities/Bookshelf.php @@ -26,7 +26,9 @@ class Bookshelf extends Entity */ public function books() { - return $this->belongsToMany(Book::class, 'bookshelves_books', 'bookshelf_id', 'book_id')->orderBy('order', 'asc'); + return $this->belongsToMany(Book::class, 'bookshelves_books', 'bookshelf_id', 'book_id') + ->withPivot('order') + ->orderBy('order', 'asc'); } /**