From fcbe95e125d5d681ac16ecaa63136e7ba5dd4f84 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Thu, 12 Oct 2023 20:22:38 +0700 Subject: [PATCH] prepare release v2.1.0 --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/README.md b/README.md index 36acab1..f9a1250 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,14 @@ $ php spark config:publish # Usage +Since `v2.1.0`, environment config can be use for multiple config with `.env` + +```env +recaptcha.recaptchaSiteKey +recaptcha.recaptchaSecretKey +recaptcha.recaptchaLang +``` + ## Initialization ```php @@ -65,6 +73,64 @@ class Example } ``` +Since `v2.0.0`, you can using helper + +```php + getScriptTag(), + 'widgetTag' => getWidget(), + ]; + + $captcha = $this->request->getPost('g-recaptcha-response'); + $response = verifyResponse($captcha); + + if (isset($response['success']) and $response['success'] === true) { + echo "You got it!"; + } + + return view('welcome_message', $data); + } +} +``` +or directly use `service` +```php + $recaptcha->getScriptTag(), + 'widgetTag' => $recaptcha->getWidget(), + ]; + + $captcha = $this->request->getPost('g-recaptcha-response'); + $response = $recaptcha->verifyResponse($captcha); + + if (isset($response['success']) and $response['success'] === true) { + echo "You got it!"; + } + + return view('welcome_message', $data); + } +} +``` + ## Render reCAPTCHA Widget - Default