Skip to content

Commit

Permalink
Merge pull request #13 from ddevsr/config-env
Browse files Browse the repository at this point in the history
feat: config environment
  • Loading branch information
ddevsr committed Sep 25, 2023
2 parents e93c6e5 + 10cbfc0 commit 5cb0ac9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use CodeIgniter\Config\Services;
use CodeIgniter\HTTP\CURLRequest;
use Exception;
use stdClass;

/**
* CodeIgniter 4 Recaptcha Library
Expand All @@ -37,8 +38,12 @@ class Recaptcha
*/
public function __construct($config)
{
$this->config = new stdClass();

// Set Config
$this->config = $config;
$this->config->recaptchaSiteKey = env('recaptcha.recaptchaSiteKey') ?? $config->recaptchaSiteKey;
$this->config->recaptchaSecretKey = env('recaptcha.recaptchaSecretKey') ?? $config->recaptchaSecretKey;
$this->config->recaptchaLang = env('recaptcha.recaptchaLang') ?? $config->recaptchaLang;

$this->curl = Services::curlrequest([
'timeout' => 5,
Expand Down

0 comments on commit 5cb0ac9

Please sign in to comment.