How can I render multiple values which belong to the same field? I have a content type with a text field "Person", which assumes up to 3 possible options. I am trying to render a block, where I would display this field with three presons.

if(\Drupal::routeMatch()-&gt;getRouteName() == 'entity.node.canonical'){
  $node = Node::load(\Drupal::routeMatch()-&gt;getRawParameter('node'));
  if($node-&gt;bundle() == "people"){


    // CONTACT
    $render = array();
    if($field = $node-&gt;field_contact_person-&gt;first()){
      $field = $field-&gt;getValue()['value'];
      $render['#markup'] = '&lt;div&gt;'.$field.'&lt;/div&gt;';
      $render['#prefix'] = '&lt;div class="block institution"&gt;&lt;h3&gt;'.$this-&gt;t('Contact person').'&lt;/h3&gt;';
      $render['#suffix'] = '&lt;/div&gt;';
      $block['#markup'] .= render($render);
    }


  }
}   


The issue is that it fetches only first value. How can I fetch all values and render them in the block?
Just don't use first() - that gets the first item.

if ($field = $node-&gt;field_contact_person) {
  foreach ($field-&gt;getValue() as $value) {
    $item_value = $value['value'];
  }
}