public function syncWithProductType(ProductTypeContract $productType, $attributeIds, array $requiredAttributes = [])
    {
        $attributeIds = is_array($attributeIds) ? $attributeIds : [$attributeIds];

        $pivot = [];
        foreach ($attributeIds as $id) {
            $pivot[$id] = ['required' => in_array($id, $requiredAttributes)];
        }

        return $productType->attributes()->sync($pivot);
    }