- if ($entity->cover instanceof Image) {
- $uploadedFile = $this->imageToUploadedFile($entity->cover);
- $inputData['image'] = $uploadedFile;
+ if ($entity instanceof HasCoverImage) {
+ $cover = $entity->cover()->first();
+ if ($cover) {
+ $inputData['image'] = $this->imageToUploadedFile($cover);
+ }