module_exists in Drupal 8 How to check if a module is enabled in Drupal 8: 1 \Drupal::moduleHandler()->moduleExists('search')