Taxonomy Term : create programmatically (Drupal)
Create Taxonomy Term (in Vocabulary):
use Drupal\taxonomy\Entity\Term;
$new_term = Term::create([
'vid' => 'name_of_the_vocabulary',
'name' => 'name of the term',
]);
$new_term->enforceIsNew();
$new_term->save();