diff --git a/dynamic_entity_reference.views.inc b/dynamic_entity_reference.views.inc
index 7cb6de8..762dac4 100644
--- a/dynamic_entity_reference.views.inc
+++ b/dynamic_entity_reference.views.inc
@@ -5,94 +5,144 @@
  * Provides views data for the dynamic_entity_reference module.
  */
 
-use Drupal\field\FieldStorageConfigInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceItem;
+use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
+use Drupal\field\Entity\FieldStorageConfig;
 
 /**
- * Implements hook_field_views_data().
+ * Implements hook_views_data().
+ *
+ * Adds relationships for dynamic_entity_reference base and config fields.
+ *
+ * @return array
  */
-function dynamic_entity_reference_field_views_data(FieldStorageConfigInterface $field_storage) {
-  $data = views_field_default_views_data($field_storage);
+function dynamic_entity_reference_views_data() {
   $entity_manager = \Drupal::entityManager();
-  $labels = $entity_manager->getEntityTypeLabels(TRUE);
-  $options = array_keys($labels['Content']);
-  $settings = $field_storage->getSettings();
-  // Identify all the target entity type ids that can be referenced.
-  if ($settings['exclude_entity_types']) {
-    $target_entity_type_ids = array_diff($options, $settings['entity_type_ids'] ?: array());
-  }
-  else {
-    $target_entity_type_ids = array_intersect($options, $settings['entity_type_ids'] ?: array());
+
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
+  $entity_types = [];
+  $sql_entity_types = [];
+  $fields_all = [];
+  foreach ($entity_manager->getDefinitions() as $entity_type) {
+    // Ensure origin and target entity types are SQL.
+    if ($entity_manager->getStorage($entity_type->id()) instanceof SqlEntityStorageInterface) {
+      $sql_entity_types[$entity_type->id()] = $entity_type->id();
+      // Only fieldable entities have base fields.
+      if ($entity_type->isSubclassOf('\Drupal\Core\Entity\FieldableEntityInterface')) {
+        $entity_types[$entity_type->id()] = $entity_type;
+        foreach ($entity_manager->getBaseFieldDefinitions($entity_type->id()) as $base_field) {
+          if ($base_field->getType() == 'dynamic_entity_reference') {
+            $fields_all[$entity_type->id()][] = $base_field;
+          }
+        }
+        foreach ($entity_manager->getFieldStorageDefinitions($entity_type->id()) as $field_storage) {
+          if ($field_storage->getType() == 'dynamic_entity_reference') {
+            $fields_all[$entity_type->id()][] = $field_storage;
+          }
+        }
+      }
+    }
   }
-  foreach ($data as $table_name => $table_data) {
-    // Add a relationship to all the target entity types.
-    foreach ($target_entity_type_ids as $target_entity_type_id) {
-      $target_entity_type = $entity_manager->getDefinition($target_entity_type_id);
-      $entity_type_id = $field_storage->getTargetEntityTypeId();
-      $entity_type = $entity_manager->getDefinition($entity_type_id);
-      $target_base_table = $target_entity_type->getDataTable() ?: $target_entity_type->getBaseTable();
-      $field_name = $field_storage->getName();
 
-      // Provide a relationship for the entity type with the dynamic entity
-      // reference field.
-      $args = array(
-        '@label' => $target_entity_type->getLabel(),
-        '@field_name' => $field_name,
-      );
-      $data[$table_name][$target_entity_type_id . '__' . $field_name]['relationship'] = array(
-        'title' => t('@label referenced from @field_name', $args),
-        'label' => t('@field_name: @label', $args),
-        'group' => $entity_type->getLabel(),
-        'help' =>  t('Appears in: @bundles.', array('@bundles' => implode(', ', $field_storage->getBundles()))),
-        'id' => 'standard',
-        'base' => $target_base_table,
-        'entity type' => $target_entity_type_id,
-        'base field' => $target_entity_type->getKey('id'),
-        'relationship field' => $field_name . '_target_id',
-        // Entity reference field only has one target type whereas dynamic
-        // entity reference field can have multiple target types that is why we
-        // need extra join condition on target types.
-        'extra' => array(
-          array(
-            'left_field' => $field_name . '_target_type',
-            'value' => $target_entity_type_id,
-          ),
-        ),
-      );
+  $data = [];
+  foreach ($fields_all as $entity_type_id => $fields) {
+    /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
+    $table_mapping = $entity_manager->getStorage($entity_type_id)->getTableMapping();
+
+    $entity_type = $entity_types[$entity_type_id];
+    $base_table = $entity_type->getDataTable() ?: $entity_type->getBaseTable();
+    foreach ($fields as $field) {
+      /** @var BaseFieldDefinition|FieldStorageConfig $field */
+      $field_name = $field->getName();
+      if ($field instanceof BaseFieldDefinition) {
+        $columns = $table_mapping->getColumnNames($field_name);
+        $column_id = $columns['target_id'];
+        $column_type = $columns['target_type'];
+        // Unlimited (-1) or > 1 store field data in a dedicated table.
+        $tables = [$base_table .= ($field->getCardinality() != 1 ? '__' . $field_name : '')];
+      }
+      else {
+        $column_id = $table_mapping->getFieldColumnName($field, 'target_id');
+        $column_type = $table_mapping->getFieldColumnName($field, 'target_type');
+        $tables = array_keys(views_field_default_views_data($field));
+      }
+
+      foreach ($tables as $table) {
+        $targets = array_intersect(DynamicEntityReferenceItem::getTargetTypes($field->getSettings()), array_keys($sql_entity_types));
+        foreach ($targets as $target_entity_type_id) {
+          $target_entity_type = $entity_types[$target_entity_type_id];
+          $target_table = $target_entity_type->getDataTable() ?: $target_entity_type->getBaseTable();
+
+          $t_args = [
+            '@origin_label' => $entity_type->getLabel(),
+            '@target_label' => $target_entity_type->getLabel(),
+            '@field_name' => $field->getLabel() ?: $field_name,
+            '@type' => $field instanceof BaseFieldDefinition ? 'base field' : 'attached field',
+          ];
+
+          // Relationship (Origin -> Target)
+          $psuedo_field = $target_entity_type_id . '__' . $field_name;
+          $data[$table][$psuedo_field]['relationship'] = [
+            'title' => t('@field_name to @target_label entities', $t_args),
+            'label' => t('@field_name: @target_label', $t_args),
+            'group' => $entity_type->getLabel(),
+            'help' => t('References to @target_label entities referenced by @field_name @type on @origin_label entities.', $t_args),
+            'id' => 'standard',
+            'base' => $target_table,
+            'base field' => $target_entity_type->getKey('id'),
+            'entity type' => $target_entity_type_id,
+            'relationship field' => $column_id,
+            'extra' => [
+              [
+                // Entity reference field only has one target type whereas dynamic
+                // entity reference field can have multiple target types that is why we
+                // need extra join condition on target types.
+                'left_field' => $column_type,
+                'value' => $target_entity_type_id,
+              ],
+            ],
+          ];
+
+          if ($field instanceof FieldStorageConfig) {
+            $data[$table][$psuedo_field]['relationship']['help'] .= '<br />' . t('Appears in: @bundles.', array('@bundles' => implode(', ', $field->getBundles())));
+          }
+
+          // Reverse Relationship (Target -> Origin)
+          $psuedo_field = 'reverse__' . $entity_type_id . '__'. $field_name;
+          $data[$target_table][$psuedo_field]['relationship'] = [
+            'title' => t('Reverse reference to @field_name @type on @origin_label', $t_args),
+            'label' => t('Reverse reference to @field_name @type on @origin_label', $t_args),
+            'group' => $target_entity_type->getLabel(),
+            'help' =>  t('Reverse reference from @target_label entities referenced by @field_name @type on @origin_label entities.', $t_args),
+            'id' => 'standard',
+            'base' => $table,
+            'base field' => $column_id,
+            'entity_type' => $entity_type_id,
+            'relationship field' => $target_entity_type->getKey('id'),
+            'join_extra' => [
+              [
+                'field' => $column_type,
+                'value' => $target_entity_type_id,
+              ],
+            ],
+          ];
 
-      // Provide a reverse relationship for the entity type that is referenced
-      // by the field.
-      $pseudo_field_name = 'reverse__' . $entity_type_id . '__' . $field_name;
-      /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
-      $table_mapping = $entity_manager->getStorage($entity_type_id)->getTableMapping();
-      $args['@entity'] = $entity_type->getLabel();
-      $args['@label'] = $target_entity_type->getLowercaseLabel();
-      $data[$target_base_table][$pseudo_field_name]['relationship'] = array(
-        'title' => t('@entity using @field_name', $args),
-        'label' => t('@field_name', array('@field_name' => $field_name)),
-        'group' => $target_entity_type->getLabel(),
-        'help' => t('Relate each @entity with a @field_name set to the @label.', $args),
-        'id' => 'entity_reverse',
-        'base' => $entity_type->getDataTable() ?: $entity_type->getBaseTable(),
-        'entity_type' => $entity_type_id,
-        'base field' => $entity_type->getKey('id'),
-        'field_name' => $field_name,
-        'field table' => $table_mapping->getDedicatedDataTableName($field_storage),
-        'field field' => $field_name . '_target_id',
-        // Entity reference field only has one target type whereas dynamic
-        // entity reference field can have multiple target types that is why we
-        // need extra join condition on target types.
-        'join_extra' => array(
-          array(
-            'field' => $field_name . '_target_type',
-            'value' => $target_entity_type_id,
-          ),
-          array(
-            'field' => 'deleted',
-            'value' => 0,
-            'numeric' => TRUE,
-          ),
-        ),
-      );
+          if ($field instanceof FieldStorageConfig) {
+            $data[$target_table][$psuedo_field]['relationship']['id'] = 'entity_reverse';
+            $data[$target_table][$psuedo_field]['relationship']['base'] = $base_table;
+            $data[$target_table][$psuedo_field]['relationship']['base field'] = $entity_type->getKey('id');
+            $data[$target_table][$psuedo_field]['relationship']['field_name'] = $field_name;
+            $data[$target_table][$psuedo_field]['relationship']['field table'] = $table_mapping->getDedicatedDataTableName($field);
+            $data[$target_table][$psuedo_field]['relationship']['field field'] = $column_id;
+            $data[$target_table][$psuedo_field]['relationship']['join_extra'][] = [
+              'field' => 'deleted',
+              'value' => 0,
+              'numeric' => TRUE,
+            ];
+          }
+        }
+      }
     }
   }
 

