Help searching email in Shield |
Can anyone give a code example of finding users by email?
To be honest, I am having a hard time understanding the docs. I learn better by example. Thanks
What do you want to do exactly?
"finding users by email" What do you mean by users? Not a user? If you want to find and get a User object by an email, you can do it with UserModel::findByCredentials(). PHP Code: $users = auth()->getProvider(); (02-13-2024, 04:15 AM)kenjis Wrote: What do you want to do exactly? Yes, sorry, I did mean just user. Thanks again for your help
I have successfully implemented Shield for complete user management, I have an admin back-end for adding users, banning, change passwords etc. If I understand your question correctly, you want to search users by email, I have this code on my admin back-end for searching users using: username, first_name, last_name, mobile_number and email (secret) and this code worked for me, you can adapt it to your own environment by deleting the extra fields:
PHP Code: $search_string = '[email protected]'; |
Welcome Guest, Not a member yet? Register Sign In |