承接 rubensrocha/solvemedia-captcha 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rubensrocha/solvemedia-captcha

最新稳定版本:0.5

Composer 安装命令:

composer require rubensrocha/solvemedia-captcha

包简介

Solve Media Captcha For Laravel.

README 文档

README

Package integration of SolveMedia captcha for Laravel

Installation

composer require rubensrocha/solvemedia-captcha

Laravel 5 - 6

Setup

NOTE This package supports the auto-discovery feature of Laravel 5.5, So skip these Setup instructions if you're using Laravel 5.5 and above.

In app/config/app.php add the following :

1- The ServiceProvider to the providers array :

Rubensrocha\SolveMediaCaptcha\SolveMediaCaptchaServiceProvider::class,

2- The class alias to the aliases array :

'SolveMediaCaptcha' => Rubensrocha\SolveMediaCaptcha\Facades\SolveMediaCaptcha::class,

3- Publish the config file

php artisan vendor:publish --provider="Rubensrocha\SolveMediaCaptcha\SolveMediaCaptchaServiceProvider"

Configuration

Add these fields in .env file :

SOLVEMEDIA_CKEY="your_public_key"
SOLVEMEDIA_VKEY="your_verification_key"
SOLVEMEDIA_HKEY="your_authentication_key"
SOLVEMEDIA_SSL=TRUE

You can obtain them from here

Display CAPTCHA

{!! SolveMediaCaptcha::display() !!}

Validation

Add 'adcopy_response' => 'required|solvemediacaptcha' to rules array :

$validate = Validator::make(Input::all(), [
	'adcopy_response' => 'required|solvemediacaptcha'
]);
Custom Validation Message

Add the following values to the custom array in the validation language file :

'custom' => [
    'adcopy_response' => [
        'required' => 'Please verify that you are not a robot.',
        'solvemediacaptcha' => 'Captcha error! try again later or contact site admin.',
    ],
],

Then check for captcha errors in the Form :

@if ($errors->has('adcopy_response'))
    <span class="help-block">
        <strong>{{ $errors->first('adcopy_response') }}</strong>
    </span>
@endif

Packages used as reference for creating this package.

anhskohbo/no-captcha => https://github.com/anhskohbo/no-captcha

traderinteractive/solvemedia-client-php => https://github.com/traderinteractive/solvemedia-client-php

Contribute

https://github.com/rubensrocha/solvemedia-captcha/pulls

统计信息

  • 总下载量: 326
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-13