承接 notix/gcaptcha 相关项目开发

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

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

notix/gcaptcha

最新稳定版本:v1.0.1

Composer 安装命令:

composer require notix/gcaptcha

包简介

NOTIX - Google ReCaptcha for laravel

README 文档

README

Latest Stable Version Total Downloads Monthly Downloads License

Instalation

composer require notix/gcaptcha

Configuration

Add CAPTCHA_SECRET, CAPTCHA_SITEKEY optionally CAPTCHA_THEME (default light)

CAPTCHA_SECRET=
CAPTCHA_SITEKEY=
#Optionally default is light theme.
CAPTCHA_THEME=

You can take the private key as well as the public key from this link)

Publish Config

php artisan vendor:publish --provider="Notix\GCaptcha\CaptchaServiceProvider"

Usage

Render captcha in '.blade.php'

{!! app('captcha')->display() !!}

Validation

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

Or make custom messages..
Add this value to the 'custom' array in the 'validation' language file.
(Your laravel project > 'lang' > 'en' (or other language folder) > 'validation.php')

'custom' => [
    'g-recaptcha-response' => [
        'required' => 'Please confirm that you are not a robot.',
        'captcha' => 'There was a problem with captcha verification, please wait or contact the administrator.',
    ],
],

Display

To display error messages you can use the standard option where all errors are displayed together. (laravel docs)

@if ($errors->any())
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif

Or if you want to show errors directly above or below the captcha

@if($errors->has('g-recaptcha-response'))
    <div class="alert alert-danger">
        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
    </div>
@endif

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固