Skip to content

Commit acf9035

Browse files
committed
UPDATED
1 parent 9a2e1f5 commit acf9035

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

config/googlerecaptchav3.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
| Score Comparision
5858
|--------------------------------------------------------------------------
5959
| Type: bool
60-
| If you enable it, the package will do score comparision from your score_setting
60+
| If you enable it, the package will do score comparision from your setting
6161
*/
6262
'is_score_enabled' => true,
6363
/*
@@ -66,16 +66,16 @@
6666
|--------------------------------------------------------------------------
6767
| Type: array
6868
| Define your score threshold, define your action
69-
| action: Google reCAPTCHA required paramater
69+
| action: Google reCAPTCHA required parameter
7070
| id: <input> id
7171
| threshold: score threshold
72-
| is_enabled: true/false, if this is true, the system will do score comparsion against your threshold for the action
72+
| score_comparision: true/false, if this is true, the system will do score comparsion against your threshold for the action
7373
*/
7474
'setting' => [
7575
[
7676
'action' => 'contact_us',
7777
'threshold' => 0,
78-
'is_enabled' => false
78+
'score_comparision' => false
7979
]
8080
],
8181
/*

src/GoogleReCaptchaV3.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ public function __construct(ReCaptchaConfigV3Interface $config, RequestClientInt
2828
$this->request = app('request');
2929
}
3030

31-
31+
/**
32+
* @param $action
33+
* @param string $name
34+
* @return mixed|null
35+
*/
3236
public function render($action, $name = 'g-recaptcha-response')
3337
{
3438
if ($this->config->isServiceEnabled() === false) {
@@ -124,11 +128,9 @@ public function verifyResponse($response)
124128
if ($this->getConfig()->isScoreEnabled()) {
125129
$count = collect($this->getConfig()->getSetting())
126130
->where('action', '=', $rawResponse->getAction())
127-
->where('is_enabled', '=', true)
131+
->where('score_comparision', '=', true)
128132
->where('threshold', '>', $rawResponse->getScore())
129133
->count();
130-
131-
132134
if ($count > 0) {
133135
$rawResponse->setSuccess(false);
134136
$rawResponse->setMessage('Score does not meet threshold.');
@@ -140,7 +142,9 @@ public function verifyResponse($response)
140142
return $rawResponse;
141143
}
142144

143-
145+
/**
146+
* @return ReCaptchaConfigV3Interface
147+
*/
144148
public function getConfig()
145149
{
146150
return $this->config;

0 commit comments

Comments
 (0)