Skip to content

Commit a8390ed

Browse files
committed
2 parents acd8f4a + 9f8cc8f commit a8390ed

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ Please register all details on host_name, site_key, secret_key and site_verify_u
6767
Specify your Score threshold and action in 'setting', e.g.
6868
``` php
6969
'setting' = [
70+
[
7071
'action' => 'contact_us', // Google reCAPTCHA required paramater
7172
'threshold' => 0.2, // score threshold
7273
'is_enabled' => false // if this is true, the system will do score comparsion against your threshold for the action
74+
]
7375
]
7476
```
7577
Note: if you want to enable Score Comparision, you also need to enable is_score_enabled to be true.
@@ -102,7 +104,7 @@ Example Usage
102104
@csrf
103105
{!! GoogleReCaptchaV3::render('contact_us') !!}
104106

105-
<input type="submit" class="g-recaptcha" value="submit">
107+
<input type="submit" value="submit">
106108
</form>
107109

108110
```
@@ -123,17 +125,25 @@ You can also customise your own template under googlerecaptchav3 folder.
123125
```
124126

125127
- $actionName: if its NULL, the package won't verify action with google response.
126-
127-
#### Facade Class
128+
129+
#### Facade Usage
128130

131+
You can also directly use registered service by calling the following method.
132+
- setAction() is optional only if you want to verify if the action is matched.
133+
- verifyResponse() which accepts the token value from your form. This return Google reCAPTCHA Response object.
129134

130135
``` php
131-
GoogleReCaptchaV3::setAction($action)->verifyResponse($response);
136+
GoogleReCaptchaV3::setAction($action)->verifyResponse($value);
132137
```
133138

134-
$action: Google reCAPTCHA definition
139+
Example Usage
135140

136-
$response: which is a value comes from g-recaptcha-response
141+
``` php
142+
GoogleReCaptchaV3::verifyResponse($value)->getMessage();
143+
GoogleReCaptchaV3::verifyResponse($value)->isSuccess();
144+
GoogleReCaptchaV3::verifyResponse($value)->toArray();
145+
GoogleReCaptchaV3::setAction($action)->verifyResponse($value)->isSuccess);
146+
```
137147

138148

139149
## Advanced Usage

0 commit comments

Comments
 (0)