erictt/recaptcha 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

erictt/recaptcha

Composer 安装命令:

composer require erictt/recaptcha

包简介

ReCaptcha For Laravel. This repo seperated script and dom which is very helpful for lazyload.

README 文档

README

  • Forked from anhskohbo/no-captcha
  • This repo's purpose is to seperate script and dom which is very useful in vuejs.
  • Still working on it.

Installation

Add the following line to the require section of composer.json:

{
    "require": {
        "erictt/recaptcha": "*"
    }
}

Setup

  1. Add ServiceProvider to the providers array in app/config/app.php.
Erictt\Recaptcha\RecaptchaServiceProvider::class,

and the following to aliases:

'Recaptcha' => Erictt\Recaptcha\Facades\Recaptcha::class,
  1. Run php artisan vendor:publish --provider="Erictt\Recaptcha\RecaptchaServiceProvider".

  2. In /config/recaptcha.php, enter your reCAPTCHA sitekey and secret keys.

Usage

Display reCAPTCHA
{!! Recaptcha->display(['dom', 'script']); !!}
  • or seperately
{!! Recaptcha->display(['dom']); !!}
{!! Recaptcha->display(['script']); !!}
  • Complete HTML codes:
<div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
    <label for="g-recaptcha-response" class="col-md-4 control-label"></label>

    <div class="col-md-6">
        {!! Recaptcha::display(['dom']) !!}
        @if ($errors->has('g-recaptcha-response'))
            <span class="help-block">
                <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
            </span>
        @endif
    </div>
</div>
Validation

Add 'g-recaptcha-response' => 'recaptcha' to rules array.

PS: I don't think we need require rule for this.

$validate = Validator::make(Input::all(), [
	'g-recaptcha-response' => 'recaptcha'
]);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固