Skip to main content

Configurations

The Laravel Captcha configuration options consist of environment variables that add flexibility and customization to the deployment and behavior of the Captcha Service. Here are the available configuration options:

CAPTCHA_DRIVER

This variable sets the active driver for Captcha. The default value is turnstile.

Supported drivers are:

  • turnstile
  • hcaptcha
  • recaptcha

You can set it in your environment variables like so:

CAPTCHA_DRIVER='hcaptcha'

CAPTCHA_SITE_KEY

By default, the value for CAPTCHA_SITE_KEY is an empty string (''). It represents the Site Key for the Captcha service currently in use.

References for the site key:

You can set it in your environment variables like so:

CAPTCHA_SITE_KEY='Your_Site_Key'

CAPTCHA_SECRET_KEY

Also defaulting to an empty string (''), CAPTCHA_SECRET_KEY sets the Site Secret for the Captcha service.

References for the secret key can be found at the links provided in the CAPTCHA_SITE_KEY section.

Here is how to set it:

CAPTCHA_SECRET_KEY='Your_Secret_Key'

CAPTCHA_LOCALE

This variable handles the localization for the Captcha service, defaulting to en.

References for the language codes:

CAPTCHA_LOCALE='es'
info

Turnstile doesn't support default localization and would need to use it with captcha container.

<x-captcha-container data-language="es" />

CAPTCHA_THEME

CAPTCHA_THEME sets the Captcha checkbox theme. The default theme is light, but it can also be set to dark.

To change the theme:

CAPTCHA_THEME='dark'

CAPTCHA_SIZE

Lastly, CAPTCHA_SIZE sets the size of the Captcha checkbox. It defaults to normal and can alternatively be set to compact.

To set the checkbox to compact:

CAPTCHA_SIZE='compact'