image_resize

This commit is contained in:
TL 2022-08-10 19:33:56 +08:00
parent dc9d9c43a4
commit 2d7f5e9ddd
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ class ImageService
public function __construct($image)
{
$this->image = $image ?: self::PLACEHOLDER_IMAGE;
if (!is_file($image)) {
$this->image = self::PLACEHOLDER_IMAGE;
}
$imagePath = public_path($this->image);
$this->imagePath = $imagePath;
}