$update->getName() ]; $this->userCommandHandler->handleUpdate($user, $data); } catch (\Throwable $e) { report($e->getMessage()); return $this->errService($e->getMessage()); } return $this->ok(__('Profile saved successfully')); } public function updatePassword(UpdatePassword $update, User $user): ServiceResultError | ServiceResultSuccess { try { $this->userCommandHandler->handleUpdatePassword($user, $update->getPassword()); } catch (\Throwable $e) { report($e->getMessage()); return $this->errService($e->getMessage()); } return $this->ok(__('The password has been changed')); } public function updateSettings(UpdateSettings $update, User $user): ServiceResultError | ServiceResultSuccess { try { $data = [ 'lang' => $update->getLang(), 'timezone' => $update->getTimezone(), ]; $this->userCommandHandler->handleUpdate($user, $data); } catch (\Throwable $e) { report($e->getMessage()); return $this->errService($e->getMessage()); } return $this->ok(__('The settings have been saved')); } }