X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ee7e1122d325b1807f993e4f0cacc40fbbc806fb..refs/pull/3068/head:/app/Entities/Repos/BookRepo.php diff --git a/app/Entities/Repos/BookRepo.php b/app/Entities/Repos/BookRepo.php index 008a9080c..a692bbaf7 100644 --- a/app/Entities/Repos/BookRepo.php +++ b/app/Entities/Repos/BookRepo.php @@ -1,30 +1,28 @@ -orderBy($sort, $order)->paginate($count); + return Book::visible()->with('cover')->orderBy($sort, $order)->paginate($count); } /** @@ -87,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; } @@ -104,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 */ @@ -117,16 +118,9 @@ class BookRepo $this->baseRepo->updateCoverImage($book, $coverImage, $removeImage); } - /** - * Update the permissions of a book. - */ - public function updatePermissions(Book $book, bool $restricted, Collection $permissions = null) - { - $this->baseRepo->updatePermissions($book, $restricted, $permissions); - } - /** * Remove a book from the system. + * * @throws Exception */ public function destroy(Book $book)