I created a module that receives the node ID from the form. On form validation, it needs to verify a node with that node ID exists.
How can I verify it?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can pass the nid to \Drupal\node\Entity\Node::load(). It will return an object if it exists, NULL if it doesn't.