feat: add desciption to category and sub category
This commit is contained in:
@@ -27,6 +27,7 @@ public function store(Request $request)
|
||||
$data = $request->validate([
|
||||
'category_id' => 'required|exists:categories,id',
|
||||
'name' => 'required|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
]);
|
||||
|
||||
$existing = SubCategory::where('category_id', $data['category_id'])
|
||||
@@ -62,6 +63,7 @@ public function update(Request $request, $id)
|
||||
$data = $request->validate([
|
||||
'category_id' => 'sometimes|exists:categories,id',
|
||||
'name' => 'sometimes|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
]);
|
||||
|
||||
$categoryId = $data['category_id'] ?? $subCategory->category_id;
|
||||
|
||||
Reference in New Issue
Block a user