Introduction to Drupal 8 Entity Validation
Entity validation refers to specifying criteria (constraints) which must be met before an entity can be saved (created or updated).
A traditional way to do this in Drupal has been to implement hook_form_alter() and add a custom…