To get list of content types (entity bundles) in Drupal 8, we need to call entity storage and load all available items
$node_types = \Drupal::entityTypeManager()
->getStorage('node_type')
->loadMultiple();
To get list of content types (entity bundles) in Drupal 8, we need to call entity storage and load all available items
$node_types = \Drupal::entityTypeManager()
->getStorage('node_type')
->loadMultiple();