2017 © Pedro Peláez
 

library captcha

Captcha for Laravel PHP Framework

image

johntaa/captcha

Captcha for Laravel PHP Framework

  • Friday, September 11, 2015
  • by johntaa
  • Repository
  • 2 Watchers
  • 6 Stars
  • 2,530 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 11 % Grown

The README.md

Captcha for Laravel 4.*

For Laravel 5 change to branch masterl5

It is just a copy of https://github.com/mewebstudio/captcha but maintained to serve Laravel framework, (*1)

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

Preview

Preview, (*3)

Installation

Note: This Script Requires GD extension to be installed

The Captcha Service Provider can be installed via Composer by requiring the mews/captcha package and setting the minimum-stability to dev (required for Laravel 4.1) in your project's composer.json., (*4)

{
    "require": {
        "laravel/framework": "4.*",
        "johntaa/captcha": "dev-master" 
    },
    "minimum-stability": "dev"
}

Update your packages with composer update or install with composer install., (*5)

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., (*6)

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

    'providers' => array(
        // ...
        'Johntaa\Captcha\CaptchaServiceProvider',
    )

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

    'aliases' => array(
        // ...
        'Captcha' => 'Johntaa\Captcha\Facades\Captcha',
    )

Configuration

To use your own settings, publish config., (*9)

$ php artisan config:publish johntaa/captcha, (*10)

Example Usage


// [your site path]/app/routes.php Route::any('/captcha-test', function() { if (Request::getMethod() == 'POST') { $rules = array('captcha' => array('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::img(), 'Captcha image') . '</p>'; $content .= '<p>' . Form::text('captcha') . '</p>'; $content .= '<p>' . Form::submit('Check') . '</p>'; $content .= '<p>' . Form::close() . '</p>'; return $content; });

The Versions

11/09 2015

dev-masterl5

dev-masterl5 https://github.com/johntaa/laravel-captcha

Captcha for Laravel PHP Framework

  Sources   Download

MIT

The Requires

 

by :johntaa

11/09 2015

dev-master

9999999-dev

Captcha for Laravel PHP Framework L4 and L5

  Sources   Download

MIT

The Requires

 

by Avatar johntaa