How to create a category on a module setup?

How to create category on module setup ?

Example 1

https://github.com/magento/magento2/blob/8fd3e8/app/code/Magento/Catalog/Setup/InstallData.php#L47-L58

Example 2

https://github.com/magento/magento2/blob/8fd3e8/app/code/Magento/Catalog/Setup/InstallData.php#L62-L71

1 Like

A post was split to a new topic: Source class “\Ocodewire\Designtool\Setup\CategorySetup” for “Ocodewire\Designtool\Setup\CategorySetupFactory” generation does not exist