dario_swain/ds-recaptcha-bundle
DSReCaptchaBundle services (e.g., ReCaptchaValidator).FormRequest or Form packages (e.g., Laravel Collective) would need middleware to inject ReCAPTCHA validation logic.ReCaptchaValidator and related services.Illuminate\Http\Request) doesn’t natively support Symfony’s FormBuilderInterface, necessitating custom validation rules or middleware.spatie/laravel-recaptcha)?.env, AWS Secrets Manager)?Symfony\Component\Form, Symfony\Component\DependencyInjection, and Symfony\Bundle\FrameworkBundle.spatie/laravel-recaptcha (v2/v3 support).mewebstudio/captcha (for non-Google CAPTCHAs).Validator facade.FormRequest may suffice without a full bundle).Illuminate\Support\ServiceProvider (instead of Symfony\Component\HttpKernel\Bundle).Illuminate\Validation\Validator for form validation.ReCaptcha::verify($token)) to abstract Google API calls.// Example middleware to validate ReCAPTCHA
public function handle($request, Closure $next) {
$validator = app('reCaptcha')->validate($request->input('g-recaptcha-response'));
if (!$validator->success()) {
throw new \Exception('CAPTCHA failed');
}
return $next($request);
}
config() helper (replace config.yml).DSReCaptchaBundle with spatie/laravel-recaptcha, which supports both v2 and v3:
composer require spatie/laravel-recaptcha
.env:
RECAPTCHA_SITE_KEY=your_site_key
RECAPTCHA_SECRET_KEY=your_secret_key
FormRequest:
use Spatie\Recaptcha\Exceptions\RecaptchaException;
use Spatie\Recaptcha\LaravelRecaptcha;
public function rules() {
return [
'g-recaptcha-response' => ['required', new \Spatie\Recaptcha\ValidatesRecaptcha],
];
}
symfony/* packages (e.g., symfony/form, symfony/dependency-injection), which may conflict with Laravel’s autoloader. Use composer require sparingly or alias dependencies.Log facade.spatie/laravel-recaptcha or a manual Google API call.FormRequest and error handling.DSReCaptchaBundle would require manual merging, increasing technical debt.spatie/laravel-recaptcha are regularly updated..env).invalid-domain or timeout would need custom logging (e.g., Laravel’s Log::error).DSReCaptchaBundle issues yields few results; Laravel-native packages have more community support.How can I help you explore Laravel packages today?