akostdev/laravel-yandex-captcha
最新稳定版本:v1.0.0
Composer 安装命令:
composer require akostdev/laravel-yandex-captcha
包简介
Yandex captcha integration for Laravel
README 文档
README
Laravel Yandex Captcha
A small package that will allow you to use Yandex SmartCaptcha in your Laravel app
Features
- Easy to use Yandex SmartCaptcha Blade component
- Easy to use Yandex SmartCaptcha validation
Installation
Install AkostDev/laravel-yandex-captcha from composer
composer require akostdev/laravel-yandex-captcha
Usage
-
Add to your .env
YANDEX_CAPTCHA_CLIENT_KEYYANDEX_CAPTCHA_SERVER_KEY -
Publish config
php artisan vendor:publish --tag=yandex-captcha-config
- Add the Blade component to the form that needs a captcha
<form action="{{route('login')}}" method="post"> @csrf <input type="text" name="email"> <input type="password" name="password"> <x-yandex-captcha></x-yandex-captcha> <button type="submit">Send</button> </form>
- Add YandexCaptcha validation rule
<?php namespace App\Http\Requests; use Dsoloview\YandexCaptcha\Rules\YandexCaptcha; use Illuminate\Foundation\Http\FormRequest; class LoginRequest extends FormRequest { public function rules(): array { return [ 'email' => ['required', 'email'], 'password' => ['required', 'string', 'min:8'], 'smart-token' => ['required', new YandexCaptcha] ]; } public function authorize(): bool { return true; } }
If you want to customize blade component you can publish it with
php artisan vendor:publish --tag=yandex-captcha-view
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-15