I'm using Laravel 4.2.
I'm creating a registration form where the user fills in their name and email address which upon successful validation then gets stored in a DB as encrypted values using Crypt::encrypt() for the email field and Hash::make() for the password field.
My issue is with generating a validation rule for the email filter which needs to be unique for each user that signs up.
With Crypt::encrypt() and Hash::make() generating random strings every time for the same input string, I can't seem to match the input value with the value in the database even though they may be the same?
What is the best practice for validating an email address (or another field) as being unique when they have to be encrypted in the database at all times?
Also, how would I amend my Auth::attempt() feature to accommodate the fact that the email field is encrypted?