2017 © Pedro Peláez
 

library captcha

A simple captcha for laravel 4

image

mohsen/captcha

A simple captcha for laravel 4

  • Thursday, August 20, 2015
  • by m-jch
  • Repository
  • 2 Watchers
  • 11 Stars
  • 2,749 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 5 Versions
  • 14 % Grown

The README.md

Captcha

A simple captcha for laravel 4, (*1)

Preview

Preview, (*2)

How to setup

update composer.json file:, (*3)

{
    "require": {
        "laravel/framework": "4.1.*",
        "mohsen/captcha": "dev-master"
    }
}

and run composer update from terminal to download files., (*4)

update app.php file in app/config directory:, (*5)

'providers' => array(
  ...
  'Mohsen\Captcha\CaptchaServiceProvider',
  ...
),
...
'aliases' => array(
  ...
  'Captcha'       => 'Mohsen\Captcha\Captcha',
  ...
),

How to use

in your HTML form add following code:, (*6)

<img src="{{Captcha::getImage()}}">
<input type="text" name="user-captcha">

and for validate user entered data just add captcha to array validation rules., (*7)

$rules = array(
  'user-captcha' => 'required|captcha'
);

$validator = Validator::make(Input::all(), $rules);

if($validator -> fails()) {
  return Redirect::back() -> withErrors($validator);
}

Captcha::getImage() parameters

All parameters are optional., (*8)

<img src="{{Captcha::getImage($count, $width, $height, $backgroundColor, $quality)}}">

$count: Number of characters [default=7], (*9)

$width: Width of image [default=160], (*10)

$height: Height of image [default=70], (*11)

$backgroundColor: Background color of image [default='efefef'], (*12)

$quality: Quality of image [default=50], (*13)

The Versions

20/08 2015

dev-master

9999999-dev

A simple captcha for laravel 4

  Sources   Download

MIT

The Requires

 

by mohsen shafiei

laravel laravel 4 captcha

23/10 2014

v2.0.2

2.0.2.0

A simple captcha for laravel 4

  Sources   Download

MIT

The Requires

 

by mohsen shafiei

laravel laravel 4 captcha

22/10 2014

v2.0.1

2.0.1.0

A simple captcha for laravel 4

  Sources   Download

MIT

The Requires

 

by mohsen shafiei

laravel laravel 4 captcha

21/09 2014

v2.0

2.0.0.0

A simple captcha for laravel 4

  Sources   Download

MIT

The Requires

 

by mohsen shafiei

laravel laravel 4 captcha

13/07 2014

v1.0

1.0.0.0

A simple captcha for laravel 4

  Sources   Download

The Requires

 

by mohsen shafiei

laravel laravel 4 captcha