Compare commits

5 Commits

Author SHA1 Message Date
b2c9242d51 Merge pull request 'Added support for Laravel 11.' (#2) from develop into main
Reviewed-on: #2
2024-04-02 22:36:12 +05:00
5faadf1eae Added support for Laravel 11. 2024-04-02 22:34:43 +05:00
88cee05963 Merge pull request 'Version 1.' (#1) from develop into main
Reviewed-on: #1
2023-12-03 01:16:14 +06:00
032185b52c Add instructions to README.md. 2023-12-03 01:06:09 +06:00
d9e9564ea8 Fix typo in 'user_agent' key assignment.
A typo in the key assignment for 'user_agent' in the CaptchaService has been fixed. The key was previously incorrectly typed as 'user_ageng'. This issue was causing problems with HTTP posts where user agent data was not being properly passed due to the misspelt key.
2023-12-03 00:58:47 +06:00
3 changed files with 33 additions and 2 deletions

View File

@@ -1,2 +1,33 @@
# captcha-rule-for-laravel # captcha-rule-for-laravel
Laravel 10. Rule Validation для сервиса https://git.kor-elf.net/kor-elf/service-captcha.
Параметры в .env.
# CAPTCHA_API_DOMAIN
Указываем адрес к сервису для проверки от робота.
Примеры: http://captcha.localhost:9008, https://captcha.localhost, http://captcha.localhost
# CAPTCHA_PRIVATE_TOKEN
Указываем приватный токен, для проверки со стороны сервера.
# CAPTCHA_CURL_TIMEOUT
Curl timeout в секундах.
По умолчанию: 10
# CAPTCHA_ENABLE_BLADE_CAPTCHA
Включает Blade::directive "captcha" (@captcha).
По умолчанию: true
# CAPTCHA_PUBLIC_TOKEN
Указываем публичный токен, который мы получаем от сервиса для проверки от робота.
# CAPTCHA_STATIC_PATH
Указываем путь к статике.
Примеры: /captcha, https://captcha.localhost/captcha
По умолчанию: env('CAPTCHA_API_DOMAIN') . '/captcha'

View File

@@ -19,7 +19,7 @@
], ],
"require": { "require": {
"php": "^8.2", "php": "^8.2",
"illuminate/support": "^10.0", "illuminate/support": "^10.0|^11.0",
"guzzlehttp/guzzle": "^7.0.1" "guzzlehttp/guzzle": "^7.0.1"
}, },
"extra": { "extra": {

View File

@@ -17,7 +17,7 @@ final readonly class CaptchaService
try { try {
$post = []; $post = [];
if (!is_null($userAgent)) { if (!is_null($userAgent)) {
$post['user_ageng'] = $userAgent; $post['user_agent'] = $userAgent;
} }
$response = Http::withHeaders([ $response = Http::withHeaders([