I'm building a function to allow an administrator to reset a user's password. The data entry screen has fields for the username and the new password. I can validate the username using the "not_unique" validation function. However I can't find an easy way to get the user entry which matches the username. I know there's a "findById" function but I can't see any sort of "findByUsername" function. Is there such a thing or do I have to do a database lookup?
Thanks
Solved my own problem. Turns out you can do it withÂ
PHP Code:
$users->findByCredentials(['username' => $this->request->getPost('username')]);