$pages->pluck($field, $split = null, $unique = false)

Extracts an array of values from each item by field

  • $field (string)
    The name of the field
  • $split (string)
    The separator to split by
  • $unique (boolean)
    If set to true, only unique values will be fetched, default is false
  • return (array)

Example

<ul>
  <?php foreach($page->children()->pluck('title') as $title): ?>
  <li><?= html($title) ?></li>
  <?php endforeach ?>
</ul>