prugala/recaptcha-bundle
A Symfony bundle for integrating Google reCAPTCHA into forms and applications. It provides configuration for site and secret keys, form and validator support, and straightforward verification of reCAPTCHA responses to help protect against spam and abuse.
DependencyInjection/ and Validator/ (or Service/) directories. This is a Symfony bundle, not a Laravel package: there is no service provider, no facade, and no config/recaptcha.php. The useful part is the server-side siteverify call and score/action validation logic, which you will re-implement in Laravel.composer require this into a Laravel app expecting it to work. It registers as a Symfony bundle via bundles.php, wires services through Symfony's container, and typically renders through Twig. None of that is discoverable by Laravel's container. Treat it as a reference implementation.config/bundles.php, create config/packages/pr_recaptcha.yaml with site_key and secret_key from env, render the v3 script in your base template, and verify the token in a controller or via the bundle's validator constraint.https://www.google.com/recaptcha/api.js?render=SITE_KEY in Blade, call grecaptcha.execute(SITE_KEY, {action: 'contact'}) on submit, post the token, and verify server-side with score >= 0.5 and action === 'contact'.siteverify payload it builds, how it checks success, score, action, and hostname, and how it exposes the threshold. Those four checks are the whole job.app/Services/Recaptcha.php wrapping Http::asForm()->post('https://www.google.com/recaptcha/api/siteverify', [...]) and returning a result object with success, score, action, and errorCodes. This mirrors what the bundle's validator does while staying idiomatic.RecaptchaRule that accepts an expected action and minimum score keeps controllers clean and makes the check reusable across forms. Pass the action per form so v3's action binding is meaningful.<x-recaptcha :action="'contact'" /> component that emits the script tag and a hidden input keeps the site key in one place and avoids duplicating the JS bootstrap. The bundle's Twig helper is the equivalent; do not try to reuse it.site_key / secret_key config with config/services.php entries reading RECAPTCHA_SITE_KEY and RECAPTCHA_SECRET_KEY. Never expose the secret in Blade or JS.RecaptchaVerifier contract with a Google implementation lets you add a fallback (hCaptcha, Turnstile) without touching call sites — something the archived bundle cannot offer.Configuration trees have no Laravel equivalent. Installing it will autoload classes but won't register services, and any Twig dependency will fail.score, action, and hostname; validating only success is the most common mistake.error-codes (invalid-input-secret, timeout-or-duplicate, invalid-input-response). The bundle does not surface these richly; your port should.6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI / 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe) so tests don't hit the live endpoint or fail on network egress.How can I help you explore Laravel packages today?