Skip to content

How to add new option to existing Product attribute programmatically in magento 2

I have an attribute with type select having some options

Now I want to add a new option to the existing product attribute programmatically.

Is it possible with using Setup DataPatch?

If yes then please give me some examples so that I can Update existing attribute to add a new option