Skip to content

Commit fb835b2

Browse files
committed
Merge pull request #102 from simondubois/master
Allow private & public key config value to be a Closure
2 parents b84d3b4 + 99ba137 commit fb835b2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Recaptcha.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function render($options = [ ])
3030
$mergedOptions = array_merge($this->config['options'], $options);
3131

3232
$data = [
33-
'public_key' => $this->config['public_key'],
33+
'public_key' => value($this->config['public_key']),
3434
'options' => $mergedOptions,
3535
'dataParams' => $this->extractDataParams($mergedOptions),
3636
];

src/Service/CheckRecaptcha.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CheckRecaptcha implements RecaptchaInterface
2424
public function check($challenge, $response)
2525
{
2626
$parameters = http_build_query([
27-
'privatekey' => app('config')->get('recaptcha.private_key'),
27+
'privatekey' => value(app('config')->get('recaptcha.private_key')),
2828
'remoteip' => app('request')->getClientIp(),
2929
'challenge' => $challenge,
3030
'response' => $response,
@@ -68,4 +68,4 @@ public function getResponseKey()
6868
{
6969
return 'recaptcha_challenge_field';
7070
}
71-
}
71+
}

src/Service/CheckRecaptchaV2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CheckRecaptchaV2 implements RecaptchaInterface
1919
public function check($challenge, $response)
2020
{
2121
$parameters = http_build_query([
22-
'secret' => app('config')->get('recaptcha.private_key'),
22+
'secret' => value(app('config')->get('recaptcha.private_key')),
2323
'remoteip' => app('request')->getClientIp(),
2424
'response' => $response,
2525
]);

0 commit comments

Comments
 (0)