I'm trying to add a few custom customer attributes, I've created a simple module to install the attributes but my InstallData.php file keeps failing.

Here's my code:

```
<?php
 namespace CustomModules\CustomerNewsletters\Setup;

 use Magento\Eav\Setup\EavSetup;
 use Magento\Eav\Setup\EavSetupFactory;
 use Magento\Framework\Setup\InstallDataInterface;
 use Magento\Framework\Setup\ModuleContextInterface;
 use Magento\Framework\Setup\ModuleDataSetupInterface;

 class InstallData implements InstallDataInterface {
   private $eavSetupFactory;

 public function __construct(EavSetupFactory $eavSetupFactory) {
    $this->eavSetupFactory = $eavSetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'new_products_newsletters',
        [
            'type'         => 'int',
            'label'        => 'New Products Newsletter',
            'input'        => 'boolean',
            'required'     => false,
            'visible'      => true,
            'user_defined' => true,
            'position'     => 999,
            'system'       => 0,
        ],
        'exclusive_offers_newsletters',
        [
            'type'         => 'int',
            'label'        => 'Exclusive Offers Newsletter',
            'input'        => 'boolean',
            'required'     => false,
            'visible'      => true,
            'user_defined' => true,
            'position'     => 999,
            'system'       => 0,
        ],
        'discounts_sales_newsletters',
        [
            'type'         => 'int',
            'label'        => 'Discounts and Sales Newsletter',
            'input'        => 'boolean',
            'required'     => false,
            'visible'      => true,
            'user_defined' => true,
            'position'     => 999,
            'system'       => 0,
        ]
    );
    $newProductsNewsletter = $this->eavConfig->getAttribute(Customer::ENTITY, 'new_products_newsletters');
    $exclusiveOffersNewsletter = $this->eavConfig->getAttribute(Customer::ENTITY, 'exclusive_offers_newsletters');
    $discountSalesNewsletter = $this->eavConfig->getAttribute(Customer::ENTITY, 'discounts_sales_newsletters');

    // more used_in_forms ['adminhtml_checkout','adminhtml_customer','adminhtml_customer_address','customer_account_edit','customer_address_edit','customer_register_address']
    $newProductsNewsletter->setData(
        'used_in_forms',
        ['adminhtml_customer']

    );
    $exclusiveOffersNewsletter->setData(
        'used_in_forms',
        ['adminhtml_customer']

    );
    $discountSalesNewsletter->setData(
        'used_in_forms',
        ['adminhtml_customer']

    );
    $newProductsNewsletter->save();
    $exclusiveOffersNewsletter->save();
    $discountSalesNewsletter->save();

    $this->removeAttribute('customer', 'new_products_newsletter');
    $this->removeAttribute('customer', 'exclusive_offers_newsletter');
    $this->removeAttribute('customer', 'discounts_and_sales_newsletter');
}

```

}

The error I get when running `php bin/magento setup:upgrade`:

> 
> Installing data... Notice: Undefined property: CustomModules\CustomerNewsletters\Setup\InstallData::$eavConfig in C:\xampp\htdocs\hooplaHooray\app\code\CustomModules\CustomerNewsletters\Setup\InstallData.php on line 55
> 
> 
>