diff --git a/src/Controllers/Admin/ManageUploadsController.php b/src/Controllers/Admin/ManageUploadsController.php index d605563..2a29b36 100644 --- a/src/Controllers/Admin/ManageUploadsController.php +++ b/src/Controllers/Admin/ManageUploadsController.php @@ -91,6 +91,4 @@ public function deletePostImageConfirmed(int $postId) return view('blogetc_admin::imageupload.deleted-post-image'); } - } - diff --git a/src/Services/PostsService.php b/src/Services/PostsService.php index 1fae846..8fe71e1 100644 --- a/src/Services/PostsService.php +++ b/src/Services/PostsService.php @@ -202,8 +202,9 @@ public function search(string $query, $max = 25): Collection return $this->repository->search($query, $max); } - public function clearImageSizes(Post $post, array $sizes) { - foreach($sizes as $size) { + public function clearImageSizes(Post $post, array $sizes) + { + foreach ($sizes as $size) { $post->$size = null; } diff --git a/src/Services/UploadsService.php b/src/Services/UploadsService.php index a753a74..6508066 100644 --- a/src/Services/UploadsService.php +++ b/src/Services/UploadsService.php @@ -622,13 +622,14 @@ public function legacyDestroyPost(/* @scrutinizer ignore-unused */ DeleteBlogEtc return $post; } - public function deletePostImage(Post $post):array{ + public function deletePostImage(Post $post): array + { $deletedImageSizes = []; - foreach(array_keys(config('blogetc.image_sizes')) as $size) { + foreach (array_keys(config('blogetc.image_sizes')) as $size) { $imageFilename = $post->$size; - $path = $this->image_destination_path() .'/'. $imageFilename; + $path = $this->image_destination_path().'/'.$imageFilename; - if($imageFilename && file_exists($path) ){ + if ($imageFilename && file_exists($path)) { unlink($path); $deletedImageSizes[] = $size; } @@ -637,4 +638,3 @@ public function deletePostImage(Post $post):array{ return $deletedImageSizes; } } -