Loop through taxonomy parents
I think you are using the word "parent" incorrectly.

The terms of a vocabulary can be sorted in a tree. And the parents of a specific term are the ones higher in that hierachy. So, if you want all parents of a term, of course you need so say, which term and give its id as $tid.

However, if you just want all terms of a taxonomy, you can use loadTree($vid) instead. $vid is the id of your vocabulary.

If you want to load all taxonomy terms, ignoring which vocabulary they belong to, then this is the best solution:

$terms = \Drupal::entityTypeManager()-&gt;getStorage('taxonomy_term')-&gt;loadMultiple();


Then, to access the term data do

foreach ($terms as $term) {
    $tid = $term-&gt;id();
    $vid = $term-&gt;getVocabularyId();
    $name = $term-&gt;getName();
}


If all you need is the ids of all the terms, this is enough:

$tids = \Drupal::entityQuery('taxonomy_term')-&gt;execute();