Other Features
Google reCAPTCHA
Setup
With you can select v2 checkbox
, v2 invisible
and v3
reCAPTCHA.
Go to your .env
file and update the keys for versions you want to use.
This is disabled by default, so to enable it set RECAPTCHA_ENABLED
to true
in your .env
.
Default version is set to v3
(reCAPTCHA v3). To update default version set RECAPTCHA_VERSION
to checkbox
(I’m not a robot checkbox) or invisible
(Invisible reCAPTCHA v2 badge) in your .env
.
Passing score for v3
is set to 0.5
by default. To update score set RECAPTCHA_V3_SCORE
to desired value in your .env
.
How to use it?
Go to reCAPTCHA dashboard https://www.google.com/recaptcha/admin/create
Copy and paste generated keys to .env
file.
- Import the component in pages where you will use it
- Include it in your template
- For
v3
, do this to get valid token
- In your form request or validator, validate the recaptcha token
Or set the rule like this (recommended) to exclude the field from validate
and validated
methods: