定制 justijndepover/laravel-google-recaptcha-v2 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

justijndepover/laravel-google-recaptcha-v2

Composer 安装命令:

composer require justijndepover/laravel-google-recaptcha-v2

包简介

Easily add Google Recaptcha V2 to your Laravel application forms

README 文档

README

Latest Version on Packagist Software License Total Downloads

Easily add Google Recaptcha V2 to your Laravel application forms

Caution

This application is still in development and could implement breaking changes. Please use at your own risk.

Explanation

This package adds an easy integration to implement google recaptcha v2 in your Laravel application and validate your request.

Installation

You can install the package with composer

composer require justijndepover/laravel-google-recaptcha-v2

After installation you can optionally publish your configuration file

php artisan vendor:publish --tag="laravel-google-recaptcha-v2-config"

configuration

This is the config file

return [

    /*
     * Your Google Recaptcha key
     */
    'key' => env('GOOGLE_RECAPTCHA_KEY'),

    /*
     * Your Google Recaptcha secret
     */
    'secret' => env('GOOGLE_RECAPTCHA_SECRET'),

    /*
     * Skip recaptcha validation in local development
     */
    'skip_in_local_development' => true,

];

The package has a default option to skip validation in local development

Usage

include the following API keys in your .env files:

GOOGLE_RECAPTCHA_KEY=yourkey
GOOGLE_RECAPTCHA_SECRET=yoursecret

include the following in your app layout to render the recaptcha:

@recaptcha

Because some js frameworks (like Vue) don't allow to have script tags inside your components, this line is required as well:

// before the closing body tag
@recaptchaScript

After that, your request can be validated with the recaptcha validation rule:

$request->validate([
    'g-recaptcha-response' => ['recaptcha'],
])

Security

If you find any security related issues, please open an issue or contact me directly at justijndepover@gmail.com.

Contribution

If you wish to make any changes or improvements to the package, feel free to make a pull request.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固