From b74cd28337d9774e37e0dbc8e541ea9026c6d7f7 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 7 Nov 2020 13:28:13 +0100 Subject: Fixed gallery delete... --- app/Http/Controllers/GalleryController.php | 4 ++-- public/imgs/camp.png | Bin 610511 -> 0 bytes public/imgs/yota.jpg | Bin 73473 -> 0 bytes resources/views/pages/gallery.blade.php | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 public/imgs/camp.png delete mode 100644 public/imgs/yota.jpg diff --git a/app/Http/Controllers/GalleryController.php b/app/Http/Controllers/GalleryController.php index d2a04c5..8022ea0 100644 --- a/app/Http/Controllers/GalleryController.php +++ b/app/Http/Controllers/GalleryController.php @@ -50,7 +50,7 @@ class GalleryController extends Controller foreach ($images as $image) { $path = 'imgs/'; $name = time() . '.' . uniqid() . '.' . $image->getClientOriginalExtension(); - $image->move($path, $name); + $image->storeAs($path, $name, 'public'); $save = new Image(); $save->path = $path; @@ -105,8 +105,8 @@ class GalleryController extends Controller { $img = Image::findOrFail($id); $path = $img->path . $img->name; - Storage::delete($path); $img->delete(); + Storage::disk('public')->delete($path); return Redirect::back()->with('status', 'Image deleted.'); } } diff --git a/public/imgs/camp.png b/public/imgs/camp.png deleted file mode 100644 index ddf7f9d..0000000 Binary files a/public/imgs/camp.png and /dev/null differ diff --git a/public/imgs/yota.jpg b/public/imgs/yota.jpg deleted file mode 100644 index 2aca0b7..0000000 Binary files a/public/imgs/yota.jpg and /dev/null differ diff --git a/resources/views/pages/gallery.blade.php b/resources/views/pages/gallery.blade.php index 502cb63..cd64b52 100644 --- a/resources/views/pages/gallery.blade.php +++ b/resources/views/pages/gallery.blade.php @@ -18,7 +18,7 @@
- {{ $image->name }} + {{ $image->name }}
@auth
-- cgit v1.2.3