X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/83d77d516665c41ca445a93119dfd97311bfb498..refs/pull/3113/head:/app/Entities/Repos/BookRepo.php diff --git a/app/Entities/Repos/BookRepo.php b/app/Entities/Repos/BookRepo.php index 68d62887b..a692bbaf7 100644 --- a/app/Entities/Repos/BookRepo.php +++ b/app/Entities/Repos/BookRepo.php @@ -1,4 +1,6 @@ -orderBy($sort, $order)->paginate($count); + return Book::visible()->with('cover')->orderBy($sort, $order)->paginate($count); } /** @@ -84,13 +85,14 @@ class BookRepo } /** - * Create a new book in the system + * Create a new book in the system. */ public function create(array $input): Book { $book = new Book(); $this->baseRepo->create($book, $input); Activity::addForEntity($book, ActivityType::BOOK_CREATE); + return $book; } @@ -101,11 +103,13 @@ class BookRepo { $this->baseRepo->update($book, $input); Activity::addForEntity($book, ActivityType::BOOK_UPDATE); + return $book; } /** * Update the given book's cover image, or clear it. + * * @throws ImageUploadException * @throws Exception */ @@ -116,6 +120,7 @@ class BookRepo /** * Remove a book from the system. + * * @throws Exception */ public function destroy(Book $book)