diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index fbbe9e9..8c46607 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -87,6 +87,7 @@ public function edit($category_id) public function update(CategoryFormValidator $request, Category $category) { try{ + dd($request->all()); /** * @Aashish * @@ -110,9 +111,12 @@ public function update(CategoryFormValidator $request, Category $category) * either use update or save. * ---------------fixed------------------- */ - $category->update($request->validated()); - return redirect()->back()->with('message', 'Edit Successful'); - + if($category->update(['category_name' => $request->category_name, + 'parent_id' => $request->parent_id])): + return redirect()->back()->with('message', 'Edit Successful'); + endif; + return redirect()->back()->with('message', 'Edit Failed'); + }catch(\Exception $e){ return redirect()->back()->with('message', $e->getMessage()); } diff --git a/resources/views/backend/modals/admin-edit-category.blade.php b/resources/views/backend/modals/admin-edit-category.blade.php index 336ec18..992efe7 100644 --- a/resources/views/backend/modals/admin-edit-category.blade.php +++ b/resources/views/backend/modals/admin-edit-category.blade.php @@ -15,7 +15,7 @@ @section('content')