0
驗證規則後,我想檢查database.and保存散列密碼我使用這下面的代碼當前照耀處的密碼寬度,但我得到的錯誤:Laravel類「HASH」未找到
錯誤代碼:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'HASH' not found
我的控制器動作:
public function update($id)
{
$rules = array(
'name' => 'required|alpha',
'family' => 'required',
'email' => 'required',
'password' => 'required|confirmed',
'password_confirmation'=>'required',
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('/admin/profile')
->withErrors($validator)
->withInput();
}
else
{
$currentPassword = User::find($id);
if ($currentPassword == HASH::make(Input::get('currpassword'))){
return Redirect::route('/admin/profile')
->with('message', 'Password Match Error')
->withInput();
}
}
}
它的哈希不是HASH – intelis