user3825129 user3825129 - 11 months ago 67
PHP Question

How to match input password and database hash password in laravel 4

How to authenticate a user password from a given request in Laravel? How is the password checked against the password hash stored in the database?

Answer Source

First, you'll need to find the User who is logging in based on email address or username or however you identify them, for example:

$user = User::where('email', '=', '')->first();

Then, you'll need to CHECK the hashed password, like so:

Hash::check('INPUT PASSWORD', $user->password);

This will return true or false based on whether or not the password matches.