+ $thumbData = $this->resizeImage($storage->get($imagePath), $width, $height, $keepRatio);
+
+ $storage->put($thumbFilePath, $thumbData);
+ $storage->setVisibility($thumbFilePath, 'public');
+ $this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 60 * 72);
+
+
+ return $this->getPublicUrl($thumbFilePath);
+ }
+
+ /**
+ * Resize image data.
+ * @param string $imageData
+ * @param int $width
+ * @param int $height
+ * @param bool $keepRatio
+ * @return string
+ * @throws ImageUploadException
+ */
+ protected function resizeImage(string $imageData, $width = 220, $height = null, bool $keepRatio = true)
+ {