use IlluminateSupportFacadesHash;
Hash::make($newPassword);
if (Hash::check('plain-text', $hashedPassword)) {
// The passwords match...
}
<?php
namespace AppHttpControllers;
use AppHttpControllersController;
use IlluminateHttpRequest;
use IlluminateSupportFacadesHash;
class PasswordController extends Controller
{
/**
* Update the password for the user.
*
* @param IlluminateHttpRequest $request
* @return IlluminateHttpResponse
*/
public function update(Request $request)
{
// Validate the new password length...
$request->user()->fill([
'password' => Hash::make($request->newPassword)
])->save();
}
}
use IlluminateSupportFacadesHash;
$hashed = Hash::make('password', [
'memory' => 1024,
'time' => 2,
'threads' => 2,
]);