Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Easy Hcaptcha Laravel Package

ethsam/easy-hcaptcha

View on GitHub
Deep Wiki
Context7
v2.0.0

First release of the full Symfony bundle rewrite. The previous 1.x line was a single-class helper; 2.0 is a proper, zero-config Symfony bundle with first-class form, validator and Twig integrations.

Added

  • EasyHcaptchaBundle with auto-config - installs via Symfony Flex with zero manual wiring.
  • HcaptchaVerifier (+ HcaptchaVerifierInterface) with strict types and a HcaptchaResponse value object carrying success, errorCodes, hostname, challengeTs, Enterprise score / scoreReason and credit.
  • Custom exception hierarchy rooted at HcaptchaExceptionInterface.
  • Symfony Form Type HcaptchaType with an auto-attached Hcaptcha constraint and a default form theme.
  • Symfony Validation Constraint #[Hcaptcha] + HcaptchaValidator with request-parameter fallback for nested forms.
  • Twig functions: hcaptcha_script(), hcaptcha_widget(), hcaptcha_invisible_widget(), hcaptcha_site_key().
  • Bundle configuration: site_key, secret_key, verify_url, timeout, enabled (test-mode toggle with no HTTP call), http_client, default_widget.
  • Test suite: 67 PHPUnit tests / 139 assertions.
  • GitHub Actions CI matrix (PHP 8.1/8.2/8.3/8.4 × Symfony 6.4 LTS / 7.4) + Codecov coverage job.
  • Trilingual documentation under docs/{en,fr,es}/.

Changed (breaking)

  • HcaptchaVerifier moved from Ethsam\EasyHcaptcha\HcaptchaVerifier to Ethsam\EasyHcaptcha\Verifier\HcaptchaVerifier. Inject HcaptchaVerifierInterface instead.
  • Configuration moved from Symfony parameters: to the bundle key easy_hcaptcha:.
  • verify() returns HcaptchaResponse instead of bool. The object implements Stringable, so if ($verifier->verify($token)) keeps working via PHP coercion; strict comparisons (=== true) must be migrated.
  • Minimum PHP 8.1 and minimum Symfony 6.4 LTS.

Security

  • The verify_url is rejected at container build time unless it uses HTTPS.
  • hcaptcha_widget() silently drops attribute names that don't match [a-zA-Z_][\w:.\-]*.
  • hcaptcha_script({ onload, render }) silently drops values that aren't valid JS identifiers.

Migration

See docs/en/upgrade-from-1.x.md - also available in Français and Español.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums