advancedideasmechanics/mezzio-recaptcha-v3-middleware

Google reCAPTCHA v3 PSR-15 Middleware and Service for Mezzio and Laminas applications

Maintainers

Package info

github.com/AdvancedIdeasMechanics/mezzio-recaptcha-v3-middleware

Homepage

Documentation

pkg:composer/advancedideasmechanics/mezzio-recaptcha-v3-middleware

Transparency log

Statistics

Installs: 24

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.18 2026-07-31 00:53 UTC

This package is auto-updated.

Last update: 2026-07-31 00:54:02 UTC


README

Mezzio Middleware for Google ReCaptcha V3

Composer

composer require advancedideasmechanics/mezzio-recaptcha-v3-middleware

Use

For route.php Middleware use.

use AdvancedIdeasMechanics\MezzioReCaptchaV3\Middleware\ReCaptchaMiddleware::class;

$app->get('/', [ReCaptchaMiddleware:class, App\Handler\HomePageHandler::class], 'home');

For use with Oauth2 Example

$app->post('/oauth/authorize', [ // Uses the withAction helper to change the expected Google action fn($container) => $container->get(ReCaptchaMiddleware::class)->withAction('oauth_login'), App\Handler\OAuthAuthorizationHandler::class, ], 'oauth.authorize');

Config

return [ 'recaptcha' => [ 'site_key' => '6Lxxxx...', 'secret_key' => '6Lxxxx...', 'score_threshold' => 0.5, ], ];