@@ -66,34 +66,39 @@ If you want to change the default template, please check Advanced Usage.
66
66
Please register all details on host_name, site_key, secret_key and site_verify_url.
67
67
68
68
Specify your Score threshold and action in 'setting', e.g.
69
-
69
+ ``` php
70
70
[
71
71
'action' => 'contact_us', // Google reCAPTCHA required paramater
72
72
'id' => 'contactus_id', // your HTML input field id
73
73
'threshold' => 0.2, // score threshold
74
74
'is_enabled' => false // if this is true, the system will do score comparsion against your threshold for the action
75
75
]
76
-
76
+ ```
77
77
Note: if you want to enable Score Comparision, you also need to enable is_score_enabled to be true.
78
78
79
79
Remember to turn on the service by enable is_service_enabled to be true.
80
80
81
- For more details please check comments in config file.
82
-
83
- {!! \RyanDeng\GoogleReCaptcha\Facades\GoogleReCaptchaV3::render($action1,$action2) !!}
84
-
85
- <form method =" POST " action =" /verify1 " >
81
+ For more details please check comments in config file.
82
+
83
+ #### Rendering View
84
+ - Pass your action name in render(...) function
85
+ - Each action should have its own mapped id which you have specified in setting file.
86
+
87
+ ``` html
88
+ {!! \RyanDeng\GoogleReCaptcha\Facades\GoogleReCaptchaV3::render($action1,$action2) !!}
89
+
90
+ <form method =" POST" action =" /verify1" >
91
+ @csrf
92
+ <input type =" hidden" id =" your_id_1" name =" g-recaptcha-response" >
93
+ <input type =" submit" class =" g-recaptcha" value =" submit" >
94
+ </form >
95
+
96
+ <form method =" POST" action =" /verify2" >
86
97
@csrf
87
- <input type =" hidden " id =" your_id_1 " name =" g-recaptcha-response " >
98
+ <input type =" hidden" id =" your_id_2 " name =" g-recaptcha-response" >
88
99
<input type =" submit" class =" g-recaptcha" value =" submit" >
89
- </form >
90
-
91
- <form method =" POST " action =" /verify2 " >
92
- @csrf
93
- <input type =" hidden " id =" your_id_2 " name =" g-recaptcha-response " >
94
- <input type =" submit " class =" g-recaptcha " value =" submit " >
95
- </form >
96
-
100
+ </form >
101
+ ```
97
102
- You can pass multiple $action in render(...)
98
103
- Please specify your id for the input below:
99
104
@@ -107,7 +112,7 @@ Note: all values should be registered in googlerecaptchav3 config file in 'setti
107
112
108
113
You can use provided Validation object to verify your reCAPTCHA.
109
114
110
- ```
115
+ ``` php
111
116
use RyanDeng\GoogleReCaptcha\Validations\GoogleReCaptchaValidationRule
112
117
$rule = [
113
118
'g-recaptcha-response' => [new GoogleReCaptchaValidationRule('action_name',$ip)]
@@ -125,7 +130,7 @@ Note: all values should be registered in googlerecaptchav3 config file in 'setti
125
130
#### Facade Class
126
131
127
132
128
- ```
133
+ ``` php
129
134
GoogleReCaptchaV3::setAction($action)->verifyResponse($response, $ip);
130
135
```
131
136
@@ -168,10 +173,6 @@ Remember to register your implementation.
168
173
YourOwnCustomImplementation::class
169
174
);
170
175
```
171
- ## Testing
172
-
173
- This test file will be added in the next release.
174
-
175
176
176
177
## Security
177
178
0 commit comments