2017 © Pedro Peláez
 

plugin laravelcaptcha

Create captcha easily with laravel.

image

lucbu/laravelcaptcha

Create captcha easily with laravel.

  • Wednesday, July 29, 2015
  • by lucbu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

LaravelCaptcha

Working on Laravel 5. French, English and Spanish!!!, (*1)

Captcha Example, (*2)

Installation

Install with composer :, (*3)

composer require lucbu\laravelcaptcha dev-master

Just add in the array providers in the file config\app.php:, (*4)

'Lucbu\LaravelCaptcha\CaptchaServiceProvider',

Publish the package using the command :, (*5)

php artisan vendor:publish --provider="Lucbu\LaravelCaptcha\CaptchaServiceProvider"

Configuration

In the file config\lucbu-laravelcaptcha.php there is some parameters that you can modify: * length: The length of the captcha (should be an integer) * listForbidden: list of letters that won't appear in captcha * icon-play: Path to icon image used to display the clicking button to hear the sounds of letters * icon-update: Path to icon image used to update the captcha * background-color: color of the captcha background (use red green blue notation ['red' => $red, 'green' => $green, 'blue' => $blue]) * text-color: color of the captcha text (use red green blue notation) * grid: Is there a grid behind the letters? * space-grid: Space between the line of the grid * line: Is there random lines on the captcha? * filter-smooth: Apply smooth filter to captcha * filter-smooth-level: Level of filter * width: width of the captcha image; * height: height of the captcha image * width-html: width of the image displayed in the view in px * height-html: height of the image displayed in the view in px * sessionKey: the key used to store the captcha in Session Variable * default_language: the language in case we don't find the sounds for the locale, (*6)

Usage

In the form view, just use the following code :, (*7)

@include('lucbu-laravelcaptcha::captcha')

You can validate the fields that has to be fulfill with captcha with the rule lucbularavelcaptcha :, (*8)

public function rules() {
    return [
        'captcha' => 'required|lucbularavelcaptcha:is_caseSensitive'
    ];
}

You can set the parameters is_caseSensitive as 'true' or 'false', the validation will take care or not of matching the case (false by default)., (*9)

You can generate a captcha in a controller like this :, (*10)

<?php namespace App\Http\Controllers;

use Lucbu\LaravelCaptcha\Services\Captcha;

class ExampleController {
    public function exampleFunction(){
        Captcha::generateCaptcha();
    }
}

The function will create the captcha and store into the session variable., (*11)

You can also get just the image using the route lucbu.laravelcaptcha.image or the sound with the route lucbu.laravelcaptcha.sound., (*12)

The player used to play the sound is based on HTML5. (<audio> tag), (*13)

The Versions

29/07 2015

dev-master

9999999-dev

Create captcha easily with laravel.

  Sources   Download

MIT

The Requires

 

by Lucas Burdeyron

laravel validation captcha audio languages

29/07 2015

v1.0.0

1.0.0.0

Create captcha easily with laravel.

  Sources   Download

MIT

The Requires

 

by Lucas Burdeyron

laravel validation captcha audio languages