reCaptcha

Google reCaptcha v2 & v3

reCAPTCHA is a free CAPTCHA service that protects websites from spam and abuse. This is a PHP library that wraps up the server-side verification step required to process responses from the reCAPTCHA service. This client supports both v2 and v3.

Installation

Use Composer to install this library from Packagist: google/recaptcha

Run the following command from your project directory to add the dependency:

composer require google/recaptcha "^1.2"

Alternatively, add the dependency directly to your composer.json file:

"require": {
    "google/recaptcha": "^1.2"
}

Requirements

Support for earlier versions of PHP

The 1.3 release moves to PHP 8 and up. For earlier versions, you will need to stay with the 1.2 releases.

Configurations

# reCaptcha Configuration
RECAPTCHA_KEY=
RECAPTCHA_SECRET=
RECAPTCHA_EXPECTED_HOSTNAME=
RECAPTCHA_EXPECTED_APK_PACKAGE_NAME=
RECAPTCHA_EXPECTED_ACTION=
RECAPTCHA_SCORE_THRESHOLD=

Sources

Last updated