Skip to content

How to sort product attribute options in magento 2 programatically

I have Magento 2.4.5 cloud edition.

I have a product attribute(brand) with 2000 options. When the Product is edited, the product options for a brand attribute are mixed up, and it is difficult to search to save an option for a product. So I want to sort these options alphabetically when we view at backend.