hahahaha
hahahaha

Reputation: 1031

Change Password in Laravel 4.2

I'm doing change password in laravel 4.2

Laravel 4.2 using hash method on password and now I want to do change password (note: not forget password).

In my case, user remember the password but he wants to change to a new password. So my form would have:

  1. old password
  2. new password
  3. new password confirmation

let's say if user enter old password correctly: 'abcd', I couldn't hash::make('abcd') and this hash is different with the hash('abcd') in my database.

Any suggestion that can do this change password efficiently in Laravel 4.2?

Upvotes: 3

Views: 236

Answers (1)

GWed
GWed

Reputation: 15653

You can't check the hash that way. As you said it will be different. Presumably what you are trying to do is validate the user entered the correct password. If that is the case, you can use:

Hash::check('abcd', $hashedPassword);

If the user entered the correct password, true will be returned. If not, false.

Upvotes: 1

Related Questions