X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/e91ef54cc9f8ce6b264bced8191275b6a33e594f..refs/pull/2023/head:/app/Entities/Repos/BaseRepo.php diff --git a/app/Entities/Repos/BaseRepo.php b/app/Entities/Repos/BaseRepo.php index 78ce505b9..7c25e4981 100644 --- a/app/Entities/Repos/BaseRepo.php +++ b/app/Entities/Repos/BaseRepo.php @@ -76,12 +76,13 @@ class BaseRepo * @throws ImageUploadException * @throws \Exception */ - public function updateCoverImage(HasCoverImage $entity, UploadedFile $coverImage = null, bool $removeImage = false) + public function updateCoverImage(HasCoverImage $entity, ?UploadedFile $coverImage, bool $removeImage = false) { if ($coverImage) { $this->imageRepo->destroyImage($entity->cover); $image = $this->imageRepo->saveNew($coverImage, 'cover_book', $entity->id, 512, 512, true); $entity->cover()->associate($image); + $entity->save(); } if ($removeImage) {