Is there a way to filter users by the first character of a field?
Yes:
$filteredUsers = $kirby->users()->filter(function($user) {
return Str::startsWith($user->fieldname()->value(), 'A');
});
Also you can use filterBy()
method like that:
$users = $kirby->users()->filterBy('fieldname', '^=', 'A');
2 Likes