validated(); if (! $this->resetPasswordAttemptService->resetPassword( $data['email'], $data['codigo'], $data['password'], RoleCode::from($request->route('reset_role', RoleCode::User->value)), )) { throw ValidationException::withMessages([ 'codigo' => __('api.auth.password_reset_invalid'), ]); } return response()->json([ 'code' => 'auth.password_updated', 'message' => __('api.auth.password_updated'), 'status' => ResetPasswordAttempt::STATUS_USED, ]); } }