Download the PHP package msglaravel/yandex-smart-captcha without Composer
On this page you can find all versions of the php package msglaravel/yandex-smart-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download msglaravel/yandex-smart-captcha
More information about msglaravel/yandex-smart-captcha
Files in msglaravel/yandex-smart-captcha
Package yandex-smart-captcha
Short Description Yandex captcha integration for Laravel
License MIT
Informations about the package yandex-smart-captcha
Laravel Yandex Smart Captcha
Laravel package for Yandex Smart Captcha. This is a lightweight package which focuses on the backend validation of Yandex Smart Captcha.
Installation
To get started, use Composer to add the package to your project's dependencies:
composer require msglaravel/yandex-smart-captcha
Add YANDEX_SMARTCAPTCHA_SITEKEY
and YANDEX_SMARTCAPTCHA_SECRET
to your .env
file.
Optionally, you can publish the config file:
Usage
Init Recaptcha Javascript
Желательно добавлять скрипт вызова библиотеки Yandex Smart Captcha в самом верху страницы. Например, в вашем header Blade-шаблоне:
Forms
Insert the captcha widget into your form using Blade include:
If you need a version with a custom onload function, use:
Use it together with @yandexSmartCaptchaScript('onloadFunction')
.
Validation
In your controller:
You can customize the error message for the captcha in your controller (applies to all errors of this rule):
Advanced
Override templates:
Copy captcha.blade.php
or captcha-extend.blade.php
from
resources/views/vendor/yandex-smart-captcha/
to your project for full customization.
Localization & Custom Error Messages
This package includes localized validation error messages for Yandex Smart Captcha in both Russian and English.
If you want to customize error messages for your project, publish the language files to your application:
This command will copy the language files to:
You can now edit these files to override any validation error messages as needed.
Note:
Laravel will use your published files in resources/lang/vendor/yandex-smart-captcha
instead of the package defaults.