Skip to content

Commit

Permalink
Taks 7: Update forbidden field DONE
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoàng Văn Tuyến committed Oct 17, 2023
1 parent fe00acc commit d405384
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function update(User $user, UpdateUserRequest $request)
{
// TASK: change this line to not allow is_admin field to be updated
// Update only the fields that are validated in UpdateUserRequest
$user->update($request->all());
$user->update($request->safe()->except('is_admin'));

return 'Success';
}
Expand Down

0 comments on commit d405384

Please sign in to comment.