Skip to content

Commit 18d69e2

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # README.md
2 parents 1f9d25c + 916b6b7 commit 18d69e2

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,39 @@ If you want to change the default template, please check Advanced Usage.
6666
Please register all details on host_name, site_key, secret_key and site_verify_url.
6767

6868
Specify your Score threshold and action in 'setting', e.g.
69-
69+
``` php
7070
[
7171
'action' => 'contact_us', // Google reCAPTCHA required paramater
7272
'id' => 'contactus_id', // your HTML input field id
7373
'threshold' => 0.2, // score threshold
7474
'is_enabled' => false // if this is true, the system will do score comparsion against your threshold for the action
7575
]
76-
76+
```
7777
Note: if you want to enable Score Comparision, you also need to enable is_score_enabled to be true.
7878

7979
Remember to turn on the service by enable is_service_enabled to be true.
8080

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">
8697
@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">
8899
<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+
```
97102
- You can pass multiple $action in render(...)
98103
- Please specify your id for the input below:
99104

@@ -107,7 +112,7 @@ Note: all values should be registered in googlerecaptchav3 config file in 'setti
107112

108113
You can use provided Validation object to verify your reCAPTCHA.
109114

110-
```
115+
``` php
111116
use RyanDeng\GoogleReCaptcha\Validations\GoogleReCaptchaValidationRule
112117
$rule = [
113118
'g-recaptcha-response' => [new GoogleReCaptchaValidationRule('action_name',$ip)]
@@ -125,7 +130,7 @@ Note: all values should be registered in googlerecaptchav3 config file in 'setti
125130
#### Facade Class
126131

127132

128-
```
133+
``` php
129134
GoogleReCaptchaV3::setAction($action)->verifyResponse($response, $ip);
130135
```
131136

@@ -168,10 +173,6 @@ Remember to register your implementation.
168173
YourOwnCustomImplementation::class
169174
);
170175
```
171-
## Testing
172-
173-
This test file will be added in the next release.
174-
175176

176177
## Security
177178

0 commit comments

Comments
 (0)