From f6766c5f237bb32ab62383df02788e8da598ea3c Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Tue, 29 Jun 2021 12:25:47 +0300 Subject: [PATCH] Support images and multipart requests --- app/Http/Controllers/Api/AccessoriesController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/AccessoriesController.php b/app/Http/Controllers/Api/AccessoriesController.php index ed0f449920..7096f388d2 100644 --- a/app/Http/Controllers/Api/AccessoriesController.php +++ b/app/Http/Controllers/Api/AccessoriesController.php @@ -86,7 +86,7 @@ class AccessoriesController extends Controller * * @author [A. Gianotto] [] * @since [v4.0] - * @param App\Http\Requests\ImageUploadRequest $request + * @param \App\Http\Requests\ImageUploadRequest $request * @return \Illuminate\Http\Response */ public function store(ImageUploadRequest $request) @@ -179,7 +179,7 @@ class AccessoriesController extends Controller * * @author [A. Gianotto] [] * @since [v4.0] - * @param App\Http\Requests\ImageUploadRequest $request + * @param \App\Http\Requests\ImageUploadRequest $request * @param int $id * @return \Illuminate\Http\Response */ @@ -188,6 +188,7 @@ class AccessoriesController extends Controller $this->authorize('update', Accessory::class); $accessory = Accessory::findOrFail($id); $accessory->fill($request->all()); + $accessory = $request->handleImages($accessory); if ($accessory->save()) { return response()->json(Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.update.success')));