captchaapi/laravel
Official Laravel SDK for captchaapi.eu (EU-hosted, GDPR-friendly proof-of-work CAPTCHA). Includes Blade widget/component, server-side verification + validation rule, and optional Livewire 4 support. PHP 8.2+, Laravel 12/13.
Pros:
.env (e.g., fail_open, timeout, locale), allowing customization for different environments (e.g., staging vs. production).Cons:
captchaapi.eu (e.g., API endpoints, token format). Migration to another CAPTCHA service would require rewriting validation logic.fail_open (defaults to true), which may not suit high-security contexts (e.g., payments).validateWithCaptcha()).<x-captchaapi::widget />) and validation rule (new ValidCaptcha) require minimal changes to existing forms.use WithCaptcha, validateWithCaptcha()).FakeCaptchaapi::enable()) simplifies unit/feature tests, including edge cases like Fortify’s double validation.captchaapi.eu experiences downtime or rate-limits requests. Mitigate with:
fail_open=false for critical paths (e.g., payments)..env updates. Risk of brief misconfiguration during rotation.preload="lazy" (default).CAPTCHAAPI_DEBUG=true.CAPTCHAAPI_SECRET_KEY leaks (e.g., via logs or .env leaks), attackers could bypass CAPTCHA. Mitigate with:
@csrf. Verify this is enabled globally.rate_limited state.CAPTCHAAPI_VERIFY_TIMEOUT=10.rate_limited or error states be communicated to users? Default styling may need localization.captchaapi.eu? High-volume forms may incur unexpected costs.captchaapi.eu shuts down or changes API?rate_limited handling).CAPTCHAAPI_DEBUG=true to log verification times.data-captcha attribute + ValidCaptcha rule).CAPTCHAAPI_FAIL_OPEN=false for critical paths (e.g., payments).CAPTCHAAPI_TIMEOUT based on pilot results (default: 5s).CAPTCHAAPI_LOCALE for multilingual sites.| Feature | Compatibility | Workaround |
|---|---|---|
| Laravel 11 | ❌ Not supported | Upgrade to Laravel 12/13 or use a different package. |
| Livewire 3 | ⚠️ Partial (trait may not work) | Use Blade forms or upgrade to Livewire 4. |
| Inertia.js | ❌ No native support | Use Blade widget + manual response handling. |
| API Routes (non-form) | ❌ Requires custom middleware | Create a middleware to validate captchaapi_response in headers. |
| Custom Frontend (React/Vue) | ⚠️ Widget script may conflict | Use the vanilla JS SDK instead. |
| Serverless (Bref, etc.) | ✅ Supported (stateless) | Ensure CAPTCHAAPI_SECRET_KEY is in env vars. |
captchaapi.eu account and obtain SITE_KEY/SECRET_KEY.composer require captchaapi/laravel
php artisan vendor:publish --tag=captchaapi-config
.env with keys and settings (e.g., CAPTCHAAPI_FAIL_OPEN=false).How can I help you explore Laravel packages today?