The Lumen Hash
facade provides secure Bcrypt hashing for storing user passwords.
Note: If you intend to use the
Hash
facade, be sure to uncomment the$app->withFacades()
call in yourbootstrap/app.php
file.
$password = Hash::make('secret');
You may also use the bcrypt
helper function:
$password = bcrypt('secret');
if (Hash::check('secret', $hashedPassword)) {
// The passwords match...
}
if (Hash::needsRehash($hashed)) {
$hashed = Hash::make('secret');
}