Spent a good amount of time trying to return all Users that match a custom field value.
Reading the docs here, it shows a findAll()
command.
However, when trying the code below, it's not working.
use craft\elements\User;
$users = User::findAll(['customField' => $value]);
return count($users);
The query doesn't fail, but rather, it times out. If I put in a non-valid custom field, an error is thrown.
Any ideas how to get a count of Users that match a custom field value?