Make your website more secure and keep the robots away!
This bundle allows you to add a simple and privacy-friendly captcha to your Symfony's forms.
No Google dependency or other third party. This is just a simple challenge, a random question that the user have to answer to validate the form.
Support | Version |
---|---|
Symfony | ^4.0 / ^5.0 |
PHP | ^7.2 / ^8.0 |
composer require ady/captcha-bundle --prefer-dist
Add a new field to your form with CaptchaType
. Some options are recommended:
mapped
should set tofalse
if your form is mapped to an entityrequired
should set totrue
So, your captcha field looks like:
use Ady\Bundle\CaptchaBundle\Form\CaptchaType;
->add('captcha', CaptchaType::class, [
'mapped' => false,
'required' => true,
])
- Consonant
Question: What is the third consonant of the word BARBITURIQUE?
Answer: B
- Letter
Question: What is the fifth letter of the word ESCARPOLETTE?
Answer: R
- Vowel
Question: What is the first vowel of the word JACTANCE?
Answer: A
The question is design like What is the %index% %letter% of the word %word%?
. The challenge is chosen randomly among available challenges. The chosen challenge defines the %letter%
and set at random the %index%
. Then, the %word%
is also pick off randomly from batch of words (see Dictionary).
You can create your own captcha. It should extend AbstractCaptcha and it must implement CaptchaInterface, that's it!
You can propose new captcha or any improvement. To do that, thanks to fork this repository and to submit one merge request. Add some unit test is appreciated. Be sure to run composer test
before submitting your code.
Also, if you have any issue, please submit it on: