diff --git a/app/Http/Controllers/GalleryController.php b/app/Http/Controllers/GalleryController.php index 3b049cd..0b8110b 100644 --- a/app/Http/Controllers/GalleryController.php +++ b/app/Http/Controllers/GalleryController.php @@ -230,4 +230,18 @@ class GalleryController extends BaseController $image->saveOrFail(); return "OK"; } + + public function saveImage($name, Request $request) { + $gallery = Gallery::getByTenantAndUrl(session("current_tenant_id"), $name); + $image = Image::query()->where("id", "=", $request->input("id"))->firstOrFail(); + if($image->gallery != $gallery->id) { + abort(400); + } + + $image->name = $request->input("name"); + $image->description = $request->input("description"); + $image->rating = $request->input("rating"); + $image->saveOrFail(); + return "OK"; + } } diff --git a/resources/views/gallery/images.blade.php b/resources/views/gallery/images.blade.php index 40ab776..b2db2b5 100644 --- a/resources/views/gallery/images.blade.php +++ b/resources/views/gallery/images.blade.php @@ -32,26 +32,28 @@
-