You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
Open `config/recaptcha.php` configuration file and set `api_site_key` and `api_secret_key`:
33
+
34
+
Open `config/recaptcha.php` configuration file and set `api_site_key`, `api_secret_key` and `version`:
35
+
33
36
```php
34
37
return [
35
38
'api_site_key' => 'YOUR_API_SITE_KEY',
36
39
'api_secret_key' => 'YOUR_API_SECRET_KEY',
40
+
'version' => 'v2' // supported: v2|invisible
37
41
];
38
42
```
39
43
For more invermation about Site Key and Secret Key please visit [Google RaCaptcha developer documentation](https://developers.google.com/recaptcha/docs/start)
44
+
Get more info about ReCAPTCHA version at https://developers.google.com/recaptcha/docs/versions
45
+
40
46
41
47
### Customize error message
42
48
Before starting please add validation recaptcha message to `resources/lang/[LANG]/validation.php` file
@@ -51,21 +57,41 @@ return [
51
57
52
58
### Embed in Blade
53
59
54
-
Insert `{!!ReCaptcha::htmlScriptTagJsApi()!!}` before closing `</head>` tag
60
+
Insert `htmlScriptTagJsApi($formId)` helper before closing `</head>` tag
61
+
You can also use `ReCaptcha::htmlScriptTagJsApi($formId)`.
62
+
`$formId` is required only if you are using **ReCAPTCHA INVISIBLE**
63
+
55
64
```blade
56
65
<!DOCTYPE html>
57
66
<html>
58
67
<head>
59
68
...
60
-
{!!ReCaptcha::htmlScriptTagJsApi()!!}
69
+
{!! htmlScriptTagJsApi(/* $formId - INVISIBLE version only */) !!}
70
+
or
71
+
{!! ReCaptcha::htmlScriptTagJsApi(/* $formId - INVISIBLE version only */) !!}
61
72
</head>
62
73
```
63
74
64
-
After you have to insert `{!!ReCaptcha::htmlFormSnippet()!!}` inside the form where you want to use the field `g-recaptcha-response`
75
+
#### If you are using ReCAPTCHA v2
76
+
After you have to insert `htmlFormSnippet()` helper inside the form where you want to use the field `g-recaptcha-response`
77
+
You can also use `ReCaptcha::htmlFormSnippet()` .
78
+
```blade
79
+
<form>
80
+
...
81
+
{!! htmlFormSnippet() !!}
82
+
<input type="submit">
83
+
</form>
84
+
```
85
+
86
+
#### If you are using ReCAPTCHA INVISIBLE
87
+
After you have to insert `htmlFormButton($buttonInnerHTML)` helper inside the form where you want to use ReCAPTCHA. This function creates submit button therefore **you don't have to insert <inputtype="submit"> or similar**.
88
+
You can also use `ReCaptcha::htmlFormButton($buttonInnerHTML)` .
89
+
`$buttonInnerHTML` is what you want to write on the submit button
0 commit comments