Integrations / Symfony

CAPTCHA bundle for Symfony

captchacore/captchacore-bundle for Symfony 6.4 LTS and 7.x — FormType, validator constraint, controller attribute and Twig function. You choose what fits your project.

Symfony 6.4 LTS & 7.x PHP 8.2+ Symfony Flex

In three steps

Protect Symfony in a few minutes

01

Install the bundle

composer require — Symfony Flex registers the bundle and creates the configuration file.

02

Keys into .env

CAPTCHACORE_URL, site key and secret as environment variables.

03

Choose the integration path

FormType for Symfony forms, constraint for DTOs, attribute for controllers, Twig function for everything else.

composer require captchacore/captchacore-bundle

# .env
CAPTCHACORE_SITE_KEY=cc_pub_…
CAPTCHACORE_SECRET_KEY=cc_sec_…

// FormType
$builder->add('captcha', CaptchaCoreType::class, [
    'form_type' => 'contact',
]);

// oder als Attribut am Controller
#[RequiresCaptcha(formType: 'register')]
public function register(Request $request): Response

What you get

Built for Symfony, not just compatible

FormType

One field in the form builder renders widget and token; verification happens in handleRequest().

Validator constraint

For DTOs and API payloads: #[CaptchaCoreToken] on the property, checked like any other constraint.

Controller attribute

#[RequiresCaptcha] verifies the token before the action runs — no code in the method.

Twig function

captchacore_widget() for hand-built forms outside the Form component.

Security badge

Optional “protected by CaptchaCore” notice with a link to the privacy policy.

Tests without network

The client is a service — replace it with a fake in tests, done.

No image puzzles

Proof of work and behavioural analysis instead of traffic lights and crosswalks — humans click once, bots compute themselves to death.

Servers in Germany

Processing on our own servers, no transfer to third countries, no cross-site tracking.

16 KB, no framework

The widget loads fast, never blocks the interface and works with keyboard and screen readers.

Frequently asked questions about Symfony

Do I need Symfony Flex?

No, but it saves registering the bundle manually and writing the configuration file.

Does it work with API Platform?

Yes, via the validator constraint on your input DTOs.

Which PHP version?

PHP 8.2 or newer, matching Symfony 6.4 LTS and 7.x.

All details, options and code examples: Documentation →

More integrations