PHPackages                             msglaravel/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. msglaravel/yandex-smart-captcha

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

msglaravel/yandex-smart-captcha
===============================

Yandex captcha integration for Laravel

v1.0.2(6mo ago)06MITPHPPHP &gt;=8.0

Since Jun 21Pushed 6mo agoCompare

[ Source](https://github.com/MSGroupFM/yandex_smart_captcha)[ Packagist](https://packagist.org/packages/msglaravel/yandex-smart-captcha)[ RSS](/packages/msglaravel-yandex-smart-captcha/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Laravel Yandex Smart Captcha
============================

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

[![Total Downloads](https://camo.githubusercontent.com/ccf035b76906cbb84c874964219b4cd5a8af0f302d0f3aaa31c04c7bfcde4058/68747470733a2f2f706f7365722e707567782e6f72672f6d73676c61726176656c2f79616e6465782d736d6172742d636170746368612f642f746f74616c2e737667)](https://packagist.org/packages/msglaravel/yandex-smart-captcha)[![Latest Stable Version](https://camo.githubusercontent.com/5fa4d364e49db49746e491426700299b38eaf8305de80ce289f3bd8e77120d70/68747470733a2f2f706f7365722e707567782e6f72672f6d73676c61726176656c2f79616e6465782d736d6172742d636170746368612f762f737461626c652e737667)](https://packagist.org/packages/msglaravel/yandex-smart-captcha)[![License](https://camo.githubusercontent.com/f85afbfe8692ca5c71e5aa72179186b8e40a69449ba5b3a4482c0d3f28810d00/68747470733a2f2f706f7365722e707567782e6f72672f6d73676c61726176656c2f79616e6465782d736d6172742d636170746368612f6c6963656e73652e737667)](https://packagist.org/packages/msglaravel/yandex-smart-captcha)

Laravel package for Yandex [Smart Captcha](https://yandex.cloud/ru/docs/smartcaptcha/). This is a lightweight package which focuses on the backend validation of Yandex Smart Captcha.

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

[](#installation)

To get started, use Composer to add the package to your project's dependencies:

```
composer require msglaravel/yandex-smart-captcha

```

Add to your `.env` file:

```
YANDEX_SMARTCAPTCHA_ENDPOINT=https://smartcaptcha.cloud.yandex.ru
YANDEX_SMARTCAPTCHA_SITEKEY=sitekey
YANDEX_SMARTCAPTCHA_SECRET=secret

```

Optionally, you can publish the config file:

```
php artisan vendor:publish --provider="MSGLaravel\YandexSmartCaptcha\YandexSmartCaptchaServiceProvider"

```

Usage
-----

[](#usage)

#### Init Recaptcha Javascript

[](#init-recaptcha-javascript)

Желательно добавлять скрипт вызова библиотеки Yandex Smart Captcha в самом верху страницы. Например, в вашем header Blade-шаблоне:

```
@yandexSmartCaptchaScript                  {{-- Basic use --}}
@yandexSmartCaptchaScript('myOnloadCb')    {{-- With custom onload callback --}}
```

#### Forms

[](#forms)

Insert the captcha widget into your form using Blade include:

```
    @include('yandex-smart-captcha::captcha')
```

If you need a version with a custom onload function, use:

```
    @include('yandex-smart-captcha::captcha-extend')
```

Use it together with `@yandexSmartCaptchaScript('onloadFunction')`.

```

    @include('yandex-smart-captcha::captcha')

```

#### Validation

[](#validation)

In your controller:

```
use MSGLaravel\YandexSmartCaptcha\Rules\YandexSmartCaptchaRule;

$request->validate([
    // ...
    'smart-token' => ['required', new YandexSmartCaptchaRule()],
]);
```

You can customize the error message for the captcha in your controller (applies to all errors of this rule):

```
use MSGLaravel\YandexSmartCaptcha\Rules\YandexSmartCaptchaRule;

$request->validate(
    [
        'smart-token' => ['required', new YandexSmartCaptchaRule()],
    ],
    [
        'smart-token' => 'Ошибка проверки капчи. Попробуйте ещё раз.',
    ]
);
```

Advanced
--------

[](#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 &amp; Custom Error Messages
----------------------------------------

[](#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:

```
php artisan vendor:publish --provider="MSGLaravel\YandexSmartCaptcha\YandexSmartCaptchaServiceProvider" --tag=lang

```

This command will copy the language files to:

```
resources/lang/vendor/yandex-smart-captcha/ru/validation.php
resources/lang/vendor/yandex-smart-captcha/en/validation.php

```

You can now edit these files to override any validation error messages as needed.

#### Note:

[](#note)

Laravel will use your published files in `resources/lang/vendor/yandex-smart-captcha` instead of the package defaults.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance66

Regular maintenance activity

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Total

3

Last Release

197d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6879a1f83db6685dc9507b7ad0660480e48e173c053147f3202bdb8d2e4f3bfb?d=identicon)[MSGroupFM](/maintainers/MSGroupFM)

---

Tags

laravelcaptchaYandex SmartCaptchaYandex Captha

### Embed Badge

![Health badge](/badges/msglaravel-yandex-smart-captcha/health.svg)

```
[![Health](https://phpackages.com/badges/msglaravel-yandex-smart-captcha/health.svg)](https://phpackages.com/packages/msglaravel-yandex-smart-captcha)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
