moduleDataSetup = $moduleDataSetup; $this->customerSetupFactory = $customerSetupFactory; $this->attributeSetFactory = $attributeSetFactory; $this->repository = $repository; } /** * {@inheritdoc} */ public function getAliases() { return []; } /** * {@inheritdoc} */ public static function getDependencies() { return []; } /** * @throws LocalizedException * @throws ValidateException */ public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var CustomerSetup $customerSetup */ $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]); $customerSetup->addAttribute(Customer::ENTITY, 'customer_abbr', [ 'type' => 'varchar', 'label' => 'Customer Abbr', 'input' => 'text', 'source' => '', 'required' => true, 'visible' => false, 'position' => 330, 'is_user_defined' => true, 'is_used_in_grid' => true, ]); $this->moduleDataSetup->getConnection()->endSetup(); } }