hook_node_insert() doesn't work hook_node_insert() doesn't work after node insertion in Drupal 8. When I'm trying to get the node details in that hook, it's not working.

My code is the following one.

use Drupal\Core\Entity\EntityInterface;

function test_node_insert(EntityInterface $node) {
    dpm($node);
}
How about hook_entity_insert

function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity){
  // do something
}


https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21entity.api.php/function/hook_entity_insert/8