after validate rules i want to check current enterd password width saved hash password on database.and i'm using this below code, but i get error :
Error Code:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'HASH' not found
my Controller Action:
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();
        }
    }
}
                I also faced this issue. But finally found the fix for the issue. Please include the following path on top of your code file. Then it may fix.
use Illuminate\Support\Facades\Hash;
                        It should be Hash::make, not HASH::make.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With