PHPackages                             matrozov/yii2-yandex-smart-captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. matrozov/yii2-yandex-smart-captcha

ActiveExtension[Utility &amp; Helpers](/categories/utility)

matrozov/yii2-yandex-smart-captcha
==================================

Yii2 Yandex Smart Captcha

1.0.0(1y ago)2797↓50%MITPHPPHP &gt;=8.0

Since Nov 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/matrozov/yii2-yandex-smart-captcha)[ Packagist](https://packagist.org/packages/matrozov/yii2-yandex-smart-captcha)[ Docs](https://github.com/matrozov/yii2-yandex-smart-captcha)[ RSS](/packages/matrozov-yii2-yandex-smart-captcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/0ba21c2ea4c564c2a16ca17885b2f7bd8ab16bd09648568ce60bf1c0e4ebb4f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6174726f7a6f762f796969322d79616e6465782d736d6172742d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/matrozov/yii2-yandex-smart-captcha)

Yii2 Yandex Smart Captcha
=========================

[](#yii2-yandex-smart-captcha)

Adds [Yandex Smart Captcha](https://yandex.cloud/en/services/smartcaptcha) into yii2 project

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist matrozov/yii2-yandex-smart-captcha "*"

```

or add

```
"matrozov/yii2-yandex-smart-captcha": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by:

add this to your components main.php

```
'components' => [
    ...
    'yandexSmartCaptcha' => [
        'class'     => 'matrozov\yii2yandexSmartCaptcha\YandexSmartCaptcha',
        'serverKey' => 'ysc2_********',
        'clientKey' => 'ysc1_********',
    ],
```

and in your model

```
public $yandexSmartCaptcha;

public function rules()
{
    return [
        ...
        [['yandexSmartCaptcha'], \matrozov\yii2yandexSmartCaptcha\YandexSmartCaptchaValidator::class],
    ];
}
```

```
