enunez/grecaptcha-validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

enunez/grecaptcha-validator

最新稳定版本:v1.0.3

Composer 安装命令:

composer require enunez/grecaptcha-validator

包简介

Google recaptcha validator

README 文档

README

Build Status Packagist License Packagist Version (including pre-releases)

The Google reCAPTCHA Verification PHP library is a tool for software developers to verify the response of Google reCAPTCHA v2 or v3 from within their PHP applications. This library simplifies the process of verifying the user's response to a reCAPTCHA challenge and provides an easy-to-use interface for integrating the verification process into your PHP code.

With this library, you can easily configure and set up reCAPTCHA verification for your PHP application, without the need for complicated coding. You can easily specify your reCAPTCHA API key, secret key, and other necessary configuration parameters, and then call the library functions to verify the response received from the reCAPTCHA challenge.

This library supports both the v2 and v3 versions of Google reCAPTCHA, so you can use it for a wide range of applications. It provides error handling and reporting functionality, allowing you to easily detect and handle any errors that may occur during the verification process.

The Google reCAPTCHA Verification PHP library is open-source and available for free on GitHub. This library helps you easily integrate the power of Google reCAPTCHA into your PHP application, ensuring that your users are protected from spam and abuse.

Quick start

Installation

Installation is handle via Composer:

$ composer require enunez/grecaptcha-validator

or add it manually to you composer.json file

{
  "require": {
    "enunez/grecaptcha-validator": "^1.0.0"
  }
}

Usage

This is a quick example of how to use the library:

$captcha = Builder::getInstance(YOUR_SHARED_KEY, USER_RESPONSE_TOKEN)->build();

$captcha->isValid();

To include the remote IP address:

$captcha = Builder::getInstance(YOUR_SHARED_KEY, USER_RESPONSE_TOKEN)->remoteIp(REMOTE_IP)->build();

$captcha->isValid();

If verification fails you can access all error codes by using:

if (!$captcha->isValid()) {
    foreach ($errorCode as $captcha->errorCodes()) {
        // processing the error code
    }
}

For more details on the supported error codes please check: https://developers.google.com/recaptcha/docs/verify#error_code_reference

License

This library is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固