tereta / recaptcha
1.0.9
2026-05-05 21:16 UTC
Requires
- php: >=8.4
- tereta/core: ^1.0
- tereta/logger: ^1.0
README
π Π ΡΡΡΠΊΠΈΠΉ | English
Google reCAPTCHA v3 integration module for Tereta Framework.
Installation
composer require tereta/recaptcha
Purpose
The module provides server-side validation of reCAPTCHA tokens, protecting forms from bots using score-based verification (threshold: 0.5).
Registration
Go to https://www.google.com/recaptcha/admin/create Create a new reCAPTCHA v3 key for your domain and get the site key and secret key.
Configuration
Two parameters must be set in the application configuration:
RecaptchaConfig::singleton()->set(RecaptchaConfig::ROOT, [
'recaptchaSiteKey' => '{recaptcha_site_key}', // Site key for Google reCAPTCHA v3
'recaptchaSecretKey' => '{recaptcha_secret_key}', // Secret key for Google reCAPTCHA v3
]);
Keys can be obtained from the Google reCAPTCHA Console.
Usage
use Tereta\Recaptcha\Services\Validator;
use Tereta\Recaptcha\Exceptions\Validation;
try {
Validator::singleton()->validate($token, 'submit');
} catch (Validation $e) {
// Token validation failed
}
Author and License
Author: Tereta Alexander
Website: tereta.dev
License: Apache License 2.0. See LICENSE.
www.ββββββββββββββββββββββββ βββββββββββββββββ ββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββ
βββ ββββββ ββββββββββββββ βββ ββββββββ
βββ ββββββ ββββββββββββββ βββ ββββββββ
βββ βββββββββββ βββββββββββ βββ βββ βββ
βββ βββββββββββ βββββββββββ βββ βββ βββ
.dev
Copyright (c) 2024-2026 Tereta Alexander