mercredi 29 avril 2020

Laravel change password issue

For Laravel change password I did like this but why it is not working.. Its not updating password. I have done login page, registration everything working. But this giving me lot of trouble. Below is my code.

        $returnValue = DB::table('users')->where('users_id', $users_id)->where('password', bcrypt($request->opassword))->update(['password'=>bcrypt($request->npassword)]);
    if($returnValue >= 1)
    {
        $success['message'] = "Password updated successfully..";
        return $this->sendResponse($success);
    }
    else
    {
        $error = "Entered Old password is not valid..";
        return $this->sendResponse($error);
    }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire