X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ee7e1122d325b1807f993e4f0cacc40fbbc806fb..refs/pull/2511/head:/app/Entities/Repos/BookRepo.php diff --git a/app/Entities/Repos/BookRepo.php b/app/Entities/Repos/BookRepo.php index 008a9080c..27d0b4075 100644 --- a/app/Entities/Repos/BookRepo.php +++ b/app/Entities/Repos/BookRepo.php @@ -2,15 +2,13 @@ use BookStack\Actions\ActivityType; use BookStack\Actions\TagRepo; -use BookStack\Entities\Book; -use BookStack\Entities\Managers\TrashCan; +use BookStack\Entities\Models\Book; +use BookStack\Entities\Tools\TrashCan; use BookStack\Exceptions\ImageUploadException; use BookStack\Exceptions\NotFoundException; -use BookStack\Exceptions\NotifyException; use BookStack\Facades\Activity; use BookStack\Uploads\ImageRepo; use Exception; -use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Http\UploadedFile; use Illuminate\Support\Collection; @@ -24,7 +22,6 @@ class BookRepo /** * BookRepo constructor. - * @param $tagRepo */ public function __construct(BaseRepo $baseRepo, TagRepo $tagRepo, ImageRepo $imageRepo) { @@ -38,7 +35,7 @@ class BookRepo */ public function getAllPaginated(int $count = 20, string $sort = 'name', string $order = 'asc'): LengthAwarePaginator { - return Book::visible()->orderBy($sort, $order)->paginate($count); + return Book::visible()->with('cover')->orderBy($sort, $order)->paginate($count); } /** @@ -117,14 +114,6 @@ 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