Skip to content

Yii3 reCAPTCHA

Google reCAPTCHA v2 and v3 form field + server-side validator for Yii3.

Packagist Version PHP from Packagist Packagist Downloads GitHub License GitHub Workflow Status

Stats for Nerds

Coverage MSI Tests Assertions


Features

  • reCAPTCHA v2 — checkbox/invisible widget field with theme, size, and type options
  • reCAPTCHA v3 — score-based field that fetches its token on form submit (not page load), avoiding surprise challenge popups
  • Server-side validation — PHP attribute rules (RecaptchaV2Rule / RecaptchaV3Rule) verified against Google's siteverify endpoint
  • Score threshold + action matching — v3 rules can enforce a minimum score and an expected action name
  • Zero-config ergonomics — once site keys are set, fields and rules work out of the box via a static registry
  • i18n — validation and legal-notice messages are translated through Yii Translator

Requirements

  • PHP 8.3+
  • PSR-17 request + stream factories
  • PSR-18 HTTP client

Installation

composer require yiirocks/recaptcha

Documentation

The complete reference guide is available at Yii.Rocks.

About

reCAPTCHA bot protection and online fraud prevention

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages