事情是这样的:
$pword = Hash::make('pass');
$input_pass = $request->('password');
dd(Hash::check($input_pass, $pword));
//Assume the input password is 'pass'结果是真实的。
但当我做同样的事:
dd(Hash::check($request->input('password'), $user->password));
//$user->password contains the value of hashed password retrieved from database.结果是假的。
发布于 2022-10-11 12:14:16
Hash facade提供的check方法允许您验证给定的纯文本字符串是否对应于给定的哈希:
if (Hash::check('plain-text', $hashedPassword)) {
// The passwords match...
}https://stackoverflow.com/questions/74027522
复制相似问题