Welcome Guest, Not a member yet? Register   Sign In
Find user by username
#1

(This post was last modified: 06-12-2023, 08:58 PM by murrence.)

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:
findByCredentials
PHP Code:
$users->findByCredentials(['username' => $this->request->getPost('username')]); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB