Skip to content

Commit

Permalink
fix: unable to update category type field
Browse files Browse the repository at this point in the history
  • Loading branch information
frknasir committed Apr 22, 2022
1 parent ab773f3 commit 03b6125
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Actions/UpdateCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public function __invoke($user, Category $category, array $data)

Validator::make($data, [
'name' => 'required|string|max:255',
'type' => 'nullable|string|max:255',
])->validateWithBag('updateCategory');

$category->update(collect($data)->only([
'name',
'type'
])->toArray());

return $category->refresh();
Expand Down

0 comments on commit 03b6125

Please sign in to comment.