Weave Code
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

Laravel Laravel Package

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.

View on GitHub
Deep Wiki
Context7

captchaapi/laravel is the official Laravel SDK for captchaapi.eu, an EU-hosted, GDPR-compliant proof‑of‑work CAPTCHA. It provides drop-in components to protect forms with server-side verification—no cookies, no tracking, and no Google dependencies.

Integrate quickly via Blade, validation rules, and optional Livewire support while keeping your secret key on the server and using a public site key in the browser.

  • EU-only hosting (Hetzner Nuremberg) for privacy by default
  • Proof-of-work challenges that stay invisible to legit users
  • Server-side verification with a single secure API call
  • Blade widget/component for easy form integration
  • Livewire 4 support via a dedicated trait and component
Frequently asked questions about Laravel
How do I integrate captchaapi/laravel into a Laravel 13 project with Livewire?
Install the package via Composer, publish the config, and add your site/secret keys to `.env`. Use the `WithCaptcha` trait in your Livewire component and wrap your form with `<x-captchaapi::livewire-form>`. The package provides a Livewire-native trait for seamless validation and widget rendering.
Does this package work with Laravel 12 or older versions?
No, this package requires Laravel 12 or 13 and PHP 8.2+. If you’re using an older Laravel version, you’ll need to upgrade or consider alternatives like hCaptcha or reCAPTCHA, which support broader Laravel versions.
How do I disable CAPTCHA in development or staging environments?
Set `CAPTCHAAPI_ENABLED=false` in your `.env` file. This disables all CAPTCHA checks without requiring code changes. The package respects this flag globally for all forms and Livewire components.
What happens if the captchaapi.eu API fails during form submission?
By default, the package uses `fail_open=true`, meaning submissions will pass if the API is unavailable. For critical actions (e.g., logins or payments), explicitly set `fail_open=false` in the config or handle failures manually in your validation logic.
Can I use this package without Livewire, or is it required?
Livewire support is optional. The package works perfectly with plain Blade forms. Use the `<x-captchaapi::widget />` component in your layout and add `data-captcha` to form fields. Livewire-specific features are only needed if you’re using Livewire 4+.
Is there a way to customize the CAPTCHA widget’s appearance or behavior?
The package provides basic customization via the config file (e.g., timeout, locale). For deeper styling, you can override the Blade component (`resources/views/vendor/captchaapi/widget.blade.php`) or use custom JavaScript to modify the widget’s behavior after initialization.
How do I test CAPTCHA validation in my Laravel tests?
Mock the CAPTCHA API responses using Laravel’s HTTP client or a testing helper like `Http::fake()`. Override the `CaptchaApi` facade or use the `ValidCaptcha` rule directly in your test assertions. Example: `Http::fake(['https://captchaapi.eu' => Http::response(['success' => true])]);`
What are the pricing implications for high-traffic sites?
captchaapi.eu uses a volume-based pricing model, which can become costly for high-traffic sites. Check their [dashboard](https://captchaapi.eu/dashboard) for current rates. For budget-sensitive projects, consider implementing a fallback (e.g., reCAPTCHA) or caching responses to reduce API calls.
Does this package support multi-language or RTL (right-to-left) layouts?
The package supports basic localization via the `locale` config option (e.g., `en`, `de`). For RTL layouts, ensure your frontend CSS handles the widget’s directionality, as the package itself doesn’t enforce RTL-specific styling. Test thoroughly in your target language.
How does this compare to hCaptcha or reCAPTCHA for Laravel?
Unlike hCaptcha or reCAPTCHA, captchaapi.eu is EU-hosted and GDPR-compliant by default, with no cookies or tracking. It’s also proof-of-work, making it invisible to legitimate users. However, it lacks the global adoption and fallback options of hCaptcha or reCAPTCHA, which may be critical for some projects.
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.
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php