2017 © Pedro Peláez
 

package captcha

laravel 5 captcha package

image

fts/captcha

laravel 5 captcha package

  • Sunday, July 15, 2018
  • by fts3232
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

captcha

Latest Stable Version Total Downloads License, (*1)

功能

  • 生成验证码
  • 检查验证码

安装

composer require fts/captcha

发布配置文件

 php artisan vendor:publish

添加服务提供者

打开 config/app.php 并添加以下内容到 providers 数组:, (*2)

fts\Captcha\CaptchaServiceProvider.php::class

用法

 Route::any('captcha-test', function()
    {
        if (Request::getMethod() == 'POST')
        {
            $rules = ['captcha' => 'required|captcha'];
            $validator = Validator::make(Input::all(), $rules);
            if ($validator->fails())
            {
                echo '

Incorrect!, (*3)

'; } else { echo ', (*4)

Matched :), (*5)

'; } }, (*6)

        $form = '<form method="post" action="captcha-test">';
        $form .= '<input type="hidden" name="_token" value="' . csrf_token() . '">';
        $form .= '<p>' . captcha_img() . '</p>';
        $form .= '<p><input type="text" name="captcha"></p>';
        $form .= '<p><button type="submit" name="check">Check</button></p>';
        $form .= '</form>';
        return $form;
    });

获取图片

captcha();

获取图片html

captcha_src();

获取图片url

captcha_img();

The Versions

15/07 2018

dev-master

9999999-dev

laravel 5 captcha package

  Sources   Download

MIT

The Requires

 

by tianshuo feng

laravel captcha

15/07 2018

v1.0.0

1.0.0.0

laravel 5 captcha package

  Sources   Download

MIT

The Requires

 

by tianshuo feng

laravel captcha