2017 © Pedro Peláez
 

library laravel-captcha

Captcha integration for the Laravel 5

image

bonecms/laravel-captcha

Captcha integration for the Laravel 5

  • Wednesday, July 11, 2018
  • by igoshev
  • Repository
  • 3 Watchers
  • 14 Stars
  • 6,405 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 1 Open issues
  • 15 Versions
  • 21 % Grown

The README.md

Captcha integration for Laravel

Latest Stable Version Total Downloads License, (*1)

example1 example2 example3 example4 example5 example6 example7 example8 example9 example10 example11 example12, (*2)

Installing Laravel Captcha Composer Package

Note: If you do not have Composer yet, you can install it by following the instructions on https://getcomposer.org, (*3)

Step 1. Install package

composer require bonecms/laravel-captcha
Captcha Laravel
v2.2 5.5 - 9.x
v2.1 5.4
v1.1 5.3 and below

Step 2 for Laravel 5.5 and below. Register the Laravel Captcha service provider

{LARAVEL_ROOT}/config/app.php:, (*4)

'providers' => [
    ...
    Igoshev\Captcha\Providers\CaptchaServiceProvider::class,
],

Using Laravel Captcha

Generate a Captcha markup in your Controller:, (*5)

<?php 

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;

class MyController extends Controller 
{
    public function getExample() 
    {
        return view('myView');
    }

}

Showing a Captcha in a View:, (*6)

...
@captcha
<input type="text" id="captcha" name="captcha" autocomplete="off">
 ...

Check user input during form submission:, (*7)

<?php 

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class MyController extends Controller 
{
    public function getExample() 
    {
        return view('myView');
    }

    public function postExample(Request $request)
    {
        $this->validate($request, [
            'captcha' => 'required|captcha'
        ]);

        // Validation passed
    }
}

Configuration

php artisan vendor:publish --tag=bone-captcha-config

```php <?php, (*8)

return [, (*9)

/* |-------------------------------------------------------------------------- | Captcha middleware |-------------------------------------------------------------------------- | */ 'middleware' => ['web'],, (*10)

/*
|--------------------------------------------------------------------------
| Captcha routes
|--------------------------------------------------------------------------
|
*/
'routes' => [
    'image'     => 'captcha/image',
    'image_tag' => 'captcha/image_tag'
],

/*
|--------------------------------------------------------------------------
| Blade directive
|--------------------------------------------------------------------------
| You can use blade directive @captcha for rendering captcha.
|
*/
'blade' => 'captcha',

/*
|--------------------------------------------------------------------------
| Validator name
|--------------------------------------------------------------------------
|
*/
'validator' => 'captcha',

/*
|--------------------------------------------------------------------------
| Captcha generator.
|--------------------------------------------------------------------------
| Must implement GeneratorInterface.
|
*/
'generator' => \Igoshev\Captcha\Captcha\Generator\GeneratorWaves::class,

/*
|--------------------------------------------------------------------------
| Storage code.
|--------------------------------------------------------------------------
| Must implement StorageInterface.
|
*/
'storage' => \Igoshev\Captcha\Captcha\Storage\SessionStorage::class,

/*
|--------------------------------------------------------------------------
| Code generator.
|--------------------------------------------------------------------------
| Must implement CodeInterface.
|
*/
'code' => \Igoshev\Captcha\Captcha\Code\SimpleCode::class,

/*
|--------------------------------------------------------------------------
| Font
|--------------------------------------------------------------------------
| Supported: "IndiraK".
|
*/
'font' => base_path('vendor/bonecms/laravel-captcha/src/resources/fonts/IndiraK.ttf'),

/*
|--------------------------------------------------------------------------
| Font size
|--------------------------------------------------------------------------
| Font size in pixels.
|
*/
'fontSize' => 26,

/*
|--------------------------------------------------------------------------
| Letter spacing
|--------------------------------------------------------------------------
| Spacing between letters in pixels.
|
*/
'letterSpacing' => 2,

/*
|--------------------------------------------------------------------------
| Code Length
|--------------------------------------------------------------------------
| You can specify an array or integer.
|
*/
'length' => [4, 5],

/*
|--------------------------------------------------------------------------
| Displayed chars
|--------------------------------------------------------------------------
| Enter the different characters.
|
*/
'chars' => 'QSFHTRPAJKLMZXCVBNabdefhxktyzj23456789',

/*
|--------------------------------------------------------------------------
| Image Size
|--------------------------------------------------------------------------
| Captcha image size can be controlled by setting the width
| and height properties.
|
|
*/
'width'  => 180,
'height' => 50,

/*
|--------------------------------------------------------------------------
| Background Captcha
|--------------------------------------------------------------------------
| You can specify an array or string.
|
*/
'background' => 'f2f2f2',

/*
|--------------------------------------------------------------------------
| Colors characters
|--------------------------------------------------------------------------
| You can specify an array or string.
|
*/
'colors' => '2980b9',

/*
|--------------------------------------------------------------------------
| Scratches
|--------------------------------------------------------------------------
| The number of scratches displayed in the Captcha.
|
*/
'scratches' => [1, 6],

/*
|--------------------------------------------------------------------------
| Id of the Captcha code input textbox
|--------------------------------------------------------------------------
| After updating the Captcha focus will be set on an element with this id.
|
*/
'inputId' => 'captcha',

];, (*11)

### Localization
Supported languages (17): 
* Arabic
* Chinese
* Dutch
* English
* French
* German
* Hindi
* Indonesian
* Italian
* Japanese
* Korean
* Persian
* Portuguese
* Russian
* Spanish
* Turkish
* Ukrainian
```bash
php artisan vendor:publish --tag=bone-captcha-lang

View

php artisan vendor:publish --tag=bone-captcha-views

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :), (*12)

paypal, (*13)

The Versions

11/07 2018

1.1.x-dev

1.1.9999999.9999999-dev https://github.com/bonecms/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Dmitriy Igoshev

captcha laravel captcha

11/07 2018

v1.1.1

1.1.1.0 https://github.com/bonecms/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Dmitriy Igoshev

captcha laravel captcha

29/01 2018

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

29/01 2018

v2.0.3

2.0.3.0 https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

29/01 2018

v2.0.01

2.0.01.0 https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

29/01 2018

v2.0.1

2.0.1.0 https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

29/01 2018

v2.0.10

2.0.10.0 https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

02/11 2017

v2.0

2.0.0.0 https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

11/10 2017

v2.0-beta

2.0.0.0-beta https://github.com/igoshev/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Dmitriy Igoshev

captcha laravel captcha

02/02 2017

v1.1

1.1.0.0 https://github.com/bonecms/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Dmitriy Igoshev

captcha laravel captcha

21/07 2015

v1.0

1.0.0.0 https://github.com/bonecms/laravel-captcha

Captcha integration for the Laravel 5

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Dmitry Igoshev

captcha laravel captcha