Modifing panel search

<?php if($users->count()): ?>
<section class="search-section">
<ul class="nav nav-list">
<?php foreach($users as $user): ?>
<li>
  <a href="<?php _u('users/' . $user['username'] . '/edit') ?>">
    <?php i('user', 'left') ?>
    <span>
      <strong><?php __(ucfirst($user['username'])) ?></strong>
      <small><?php echo $user['email'] ?></small>
      <small><?php echo $user['lastname] ?></small> --> undefined index !!!!!!
    </span>
  </a>
</li>
<?php endforeach ?>
</ul>
</section>
<?php endif ?>

hi.
In kirby 2.3 modify the search so that in the results of the panel the first name and surname will appear instead of the username and email

Now I can not do it again in version 2.4.

Only supports username and email, other fields return:

Undefined index: firstname

The $user variable does not contain any other data than username and email, you can test this by doing a var_dump().

Is there a posibility to add it? on users controllers the variable $users = panel()->users(); i am missing something?

$users = panel()->users();

// filter all users which cannot be read
$users = $users->filter(function($user) {
  return $user->ui()->read();
});

It achieves, now the search of the user panel, indexes user name, email, name and surname.

The place to edit is panel / src / search.php

There you can add fields to the user variable and the search function.

If anyone needs I can explain it in more detail

thaks texnixe