diff --git a/app/Controllers/Trait/UploadsImage.php b/app/Controllers/Trait/UploadsImage.php index b341ef527..fb42af046 100644 --- a/app/Controllers/Trait/UploadsImage.php +++ b/app/Controllers/Trait/UploadsImage.php @@ -21,11 +21,11 @@ public function uploadImage($model): bool { if (request()->hasFile($this->form_field_name)) { - File::ensureDirectoryExists($this->getStrippedDirectoryPath($model)); + File::ensureDirectoryExists($model->getImageDirectory()); $img = request()->{$this->form_field_name}->store($this->getStrippedDirectoryPath($model)); $model->attachImage($img); if (extension_loaded('gd')) { - File::ensureDirectoryExists($this->getStrippedDirectoryPath($model) . '/thumbs'); + File::ensureDirectoryExists($model->getImageDirectory() . '/thumbs'); \Intervention\Image\ImageManagerStatic::make(storage_path($img))->fit(300, 200)->save($model->getThumbnailDirectory(). DIRECTORY_SEPARATOR . $model->image); }