2017 © Pedro Peláez
 

library captcha

Captcha Package for Laravel 5

image

latrell/captcha

Captcha Package for Laravel 5

  • Monday, September 18, 2017
  • by Latrell
  • Repository
  • 1 Watchers
  • 6 Stars
  • 4,348 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 7 Versions
  • 4 % Grown

The README.md

For Laravel 4, please use the 1.1 branch!, (*1)

Captcha for Laravel 5

A simple Laravel 5 service provider for including the Captcha for Laravel 5., (*2)

This library is not maintained for 3rd party use., (*3)

Preview

Captchas examples, (*4)

Installation

composer require latrell/captcha dev-master

Usage

To use the Captcha Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this (only for Laravel 5.4 or below)., (*5)

Find the providers key in config/app.php and register the Captcha Service Provider., (*6)

    'providers' => [
        // ...
        'Latrell\Captcha\CaptchaServiceProvider',
    ]

Find the aliases key in config/app.php., (*7)

    'aliases' => [
        // ...
        'Captcha' => 'Latrell\Captcha\Facades\Captcha',
    ]

Custom error messages. Add key captcha to resources/lang/[local]/validation.php, (*8)

return [
    // ...
    'captcha' => '图片验证码不正确。',
];

Then publish the config file with php artisan vendor:publish. This will add the file config/latrell-captcha.php. This config file is the primary way you interact with Captcha., (*9)

Example Usage


// [your site path]/app/Http/routes.php Route::any('/captcha-test', function() { if (Request::getMethod() == 'POST') { $rules = ['captcha' => 'required|captcha']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { echo '<p style="color: #ff0000;">Incorrect!</p>'; } else { echo '<p style="color: #00ff30;">Matched :)</p>'; } } $content = Form::open(array(URL::to(Request::segment(1)))); $content .= '<p>' . HTML::image(Captcha::url()) . '</p>'; $content .= '<p>' . Form::text('captcha') . '</p>'; $content .= '<p>' . Form::submit('Check') . '</p>'; $content .= '<p>' . Form::close() . '</p>'; return $content; });

The Versions

18/09 2017

dev-master

9999999-dev

Captcha Package for Laravel 5

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel security captcha laravel 5 l5 captcha image

18/09 2017

1.4

1.4.0.0

Captcha Package for Laravel 5

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel security captcha laravel 5 l5 captcha image

02/03 2017

1.3

1.3.0.0

Captcha Package for Laravel 5

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel security captcha laravel 5 l5 captcha image

09/11 2016

1.2

1.2.0.0

Captcha Package for Laravel 5

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel security captcha laravel 5 l5 captcha image

09/11 2014

1.1

1.1.0.0

Captcha Package for Laravel 4

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel laravel 4 security captcha l4 captcha image

25/04 2014

1.0.2

1.0.2.0

Captcha Package for Laravel 4

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel laravel 4 security captcha l4 captcha image

25/04 2014

1.0

1.0.0.0

Captcha Package for Laravel 4

  Sources   Download

MIT

The Requires

 

by Latrell Chan

laravel laravel 4 security captcha l4 captcha image