cms-token/@core/resources/views/frontend/partials/google-captcha.blade.php

14 lines
684 B
PHP

@php $site_google_captcha_v3_site_key = get_static_option('site_google_captcha_v3_site_key'); @endphp
@if(!empty($site_google_captcha_v3_site_key))
<script src="https://www.google.com/recaptcha/api.js?render={{get_static_option('site_google_captcha_v3_site_key')}}"></script>
<script>
grecaptcha.ready(function () {
grecaptcha.execute("{{get_static_option('site_google_captcha_v3_site_key')}}", {action: 'homepage'}).then(function (token) {
if(document.getElementById('gcaptcha_token') != null){
document.getElementById('gcaptcha_token').value = token;
}
});
});
</script>
@endif