aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Http/Controllers/GalleryController.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/Http/Controllers/GalleryController.php b/app/Http/Controllers/GalleryController.php
index 3f11997..db0f956 100644
--- a/app/Http/Controllers/GalleryController.php
+++ b/app/Http/Controllers/GalleryController.php
@@ -46,12 +46,13 @@ class GalleryController extends Controller
]);
$images = $request->file('images');
foreach ($images as $image) {
- $save = new Image();
- $save->path = 'imgs/';
- $save->name = time() . '.' . $image->getClientOriginalExtension();
-
- $image->storeAs($save->path, $save->name);
+ $path = 'imgs/';
+ $name = time() . '.' . $image->getClientOriginalExtension();
+ $image->move($path, $name);
+ $save = new Image();
+ $save->path = $path;
+ $save->name = $name;
$save->save();
}