Implements hook_entity_delete().
public function entityDelete(EntityInterface $entity) { if (in_array($entity->getEntityTypeId(), [ 'field_storage_config', 'field_config', ])) { // @todo Only do this when relationship fields are updated, not just any field. Routes::rebuild(); } }