diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 2ed75cc..75fc514 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -25,11 +25,10 @@ class ProfileController extends Controller public function update(UserRequest $request) { - $data = $request->validated(); + $data = collect($request->validated()); $user = $request->user(); - $user->username = $data['username']; - $user->character_id = $data['character_id']; + $user->fill($data->except('password')->toArray()); $user->password = Hash::make($data['password']); $user->save();