trueifnotfalse/lumen-captcha 问题修复 & 功能扩展

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

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

trueifnotfalse/lumen-captcha

最新稳定版本:1.0.3

Composer 安装命令:

composer require trueifnotfalse/lumen-captcha

包简介

Laravel Lumen Captcha Package

README 文档

README

Preview

Preview

Installation

The Captcha Service Provider can be installed via Composer by requiring the trueifnotfalse/lumen-captcha package.

Require this package with composer:

composer require trueifnotfalse/lumen-captcha

Update your packages with composer update or install with composer install.

Usage

To use the Captcha Service Provider, you must register the provider when bootstrapping your application. There are essentially two ways to do this.

Add to bootstrap/app.php and register the Captcha Service Provider.

    $app->register(TrueIfNotFalse\LumenCaptcha\CaptchaServiceProvider::class);

Configuration

To use your own settings, create config file.

config/captcha.php

return [
    'math' => [
        'length'    => 5,
        'width'     => 120,
        'height'    => 36,
        'quality'   => 90,
        'math'      => true,  //Enable Math Captcha
        'expire'    => 60,    //Stateless/API captcha expiration
    ],
    // ...
];

and enable it in bootstrap/app.php

    $app->configure('captcha');

Stateless Mode:

You get key and img from this url http://localhost/captcha?config=math and verify the captcha using this method:

    //key is the one that you got from json response
    $rules = ['captcha' => 'required|captcha:'. request('key') . ',math'];

Return Image

captcha();

Return URL

captcha_src();

Return HTML

captcha_img();

To use different configurations

captcha_img('flat');

captcha_img('inverse');

etc.

Based on Intervention Image

Links

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 469
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-28