id); if (passwordValidate($pass = $_POST['password'])) { $password->password = password_hash($pass, PASSWORD_DEFAULT); if (!$password->save()) { http_response_code(500); } else { http_response_code(201); } } else { http_response_code(400); echo json_encode(["message" => "password not valid"]); } } else { http_response_code(400); } } else { http_response_code(401); echo json_encode(["message" => "is not login"]); }