1 month ago

Looking for a good tutorial on implementing recaptcha v3 on Laravel 6

Posted 1 month ago by mrkarma4ya

I've been looking for a good tutorial on the topic, but I haven't found any that is beginner'friendly.

I'm looking for one that teaches how to install and implement Google Recaptcha using this package:

Most tutorials are just blocks of code saying - copy this into that, but I don't know what they do at all.

What I've done:

Generated the site and secret keys and put them in my env file.

This is in my header:

<script src="{{ env('CAPTCHA_SITE_KEY') }}"></script>

This is in footer:

        grecaptcha.ready(function() {
    grecaptcha.execute('{{ env('CAPTCHA_SITE_KEY') }}', {action: 'contact-us'}).then(function(token) {
           document.getElementById('recaptcha').value = token;

And this is the field in contact form:

<input type="hidden" name="recaptcha" id="recaptcha">

After this, I'm completely lost.

Please sign in or create an account to participate in this conversation.