captcha-com/captcha
Laravel/PHP client for captcha.com. Helps you integrate CAPTCHA solving/verification into your app with simple API calls, configuration support, and helper methods for common workflows like submitting challenges and retrieving results.
botdetect core library (closed-source components) could limit forks or audits.Validator (e.g., Captcha::validate()) and FormRequest middleware.CaptchaServiceProvider for dependency injection.@captcha) simplify frontend rendering.botdetect:generate) for async processing.captcha_tokens table (or session storage) for token validation.botdetect licensing changes.minScore) could block users or allow bots.laravel-captcha) to compare bot detection rates.throttle) as a secondary defense.captcha_failed events in Sentry/New Relic to adjust thresholds.botdetect enterprise features) for advanced use cases?hcaptcha, cloudflare-turnstile) reduce risk?botdetect core library changes (e.g., breaking API)?Illuminate\Validation\Validator to add captcha rule:
use Captcha\Captcha;
Validator::extend('captcha', function ($attribute, $value, $parameters, $validator) {
return Captcha::validate($value);
});
CaptchaMiddleware:
Route::middleware(['captcha.verify'])->group(function () {
Route::post('/login');
});
CaptchaGenerated/CaptchaFailed events for analytics.@captcha directive in forms.axios for SPAs:
axios.post('/api/captcha/generate').then(response => {
document.getElementById('captcha').src = response.data.image;
});
redis (for session-based) or database (for persistence).file or s3) with short TTLs./contact) with Captcha::generate().captcha_failed rate (target: <1% of traffic)./reset-password) via middleware.laravel-ff) to toggle CAPTCHA per user segment.Captcha::fallback() to serve static CAPTCHAs if generation fails.gd/imagick if other image libraries are used. Resolve via:
composer require ext-gd
captcha_tokens) may need adjustments for multi-tenant apps.composer require captcha-com/captcha.php artisan vendor:publish --provider="Captcha\CaptchaServiceProvider".config/captcha.php (e.g., difficulty, storage).app/Http/Kernel.php.Captcha::validate() with mock tokens.captcha.* logs in ELK/Sentry.botdetect changelog.config/captcha.php if APIs change.botdetect core library deprecation. Mitigate by:
captcha-com release notes.Captcha::generate() edge cases.token_lifetime in config.gd/imagick extensions.minScore or whitelist IPs.debug: true in config for verbose logs.Captcha::getLastError() in exception handlers.botdetect:generate).Redis::remember()).botdetect:simple mode for low-risk flows.top/htop for PHP-FPM workers.Captcha::generate() latency.redis for O(1) lookups.| Failure | Impact | Mitigation |
|---|---|---|
| CAPTCHA generation fails | Users see broken images | Fallback to static CAPTCHA or error page. |
| Token validation errors | False positives/negatives | Implement retry logic or manual review. |
| Database/Redis outage | Token validation fails | Use local |
How can I help you explore Laravel packages today?