keized/recaptcha-bundle

This bundle provides easy integration of Recaptcha v2 into symfony 4


Keywords
Google ReCaptcha
License
MIT

Documentation

RecaptchaBundle

Installation

composer require keized/recaptcha-bundle

Register the bundle

// config/bundles.php
KeiZed\RecaptchaBundle\RecaptchaBundle::class => ['all' => true]

Add this javascript into your template

 <script src="https://www.google.com/recaptcha/api.js" async defer></script> 

Add configuration

// config/packages/recaptcha.yaml
recaptcha:
  key: <key>
  secret: <secret>

How to use

In FormType

$builder->add('captcha', RecaptchaSubmitType::class)