Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 782 Bytes

hashing.md

File metadata and controls

34 lines (21 loc) · 782 Bytes

Hashing

Introduction

The Lumen Hash facade provides secure Bcrypt hashing for storing user passwords.

Basic Usage

Note: If you intend to use the Hash facade, be sure to uncomment the $app->withFacades() call in your bootstrap/app.php file.

Hashing A Password Using Bcrypt

$password = Hash::make('secret');

You may also use the bcrypt helper function:

$password = bcrypt('secret');

Verifying A Password Against A Hash

if (Hash::check('secret', $hashedPassword))	{
	// The passwords match...
}

Checking If A Password Needs To Be Rehashed

if (Hash::needsRehash($hashed))	{
	$hashed = Hash::make('secret');
}