]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Bookshelf.php
Update maintenance.php
[bookstack] / app / Entities / Bookshelf.php
index 08ce8d8cba06d8f71d0d452a3829ea4a971978c5..1de767feca132a283803e04470b8936fa9be3ffe 100644 (file)
@@ -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');
     }
 
     /**