2017 © Pedro Peláez
 

library simple-captcha

Simple Captcha Service Provider for laravel 5

image

developer-tz/simple-captcha

Simple Captcha Service Provider for laravel 5

  • Tuesday, April 11, 2017
  • by developer-tz
  • Repository
  • 1 Watchers
  • 20 Stars
  • 476 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

Simple Captcha package for Laravel 5

A simple Laravel 5 package for including the Simple Captcha for Laravel 5., (*1)

Installation

The Simple Captcha Service Provider can be installed via Composer by requiring the developer-tz/simple-captcha package and setting the minimum-stability to dev in your project's composer.json., (*2)

{
    "require": {
        "laravel/framework": "5.*",
        "developer-tz/simple-captcha": "dev-master"
    },
    "minimum-stability": "dev"
}

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

In Windows, you'll need to include the GD2 DLL php_gd2.dll as an extension in php.ini., (*4)

Usage

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

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

    'providers' => array(
        // ...
        'DeveloperTz\SimpleCaptcha\SimpleCaptchaServiceProvider',
    )

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

    'aliases' => array(
        // ...
        'SimpleCaptcha'      => 'DeveloperTz\SimpleCaptcha\Facades\SimpleCaptcha',
    )

Configuration

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

$ php artisan vendor:publish, (*9)

Example Usage


// [your site path]/app/routes.php Route::any('/simple-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(SimpleCaptcha::img(), 'Captcha image') . '</p>'; $content .= '<p>' . Form::text('captcha') . '</p>'; $content .= '<p>' . Form::submit('Check') . '</p>'; $content .= '<p>' . Form::close() . '</p>'; return $content; });

^_^, (*10)

Captcha package for earlier versions,

The Versions

11/04 2017

dev-master

9999999-dev https://github.com/developer-tz/laravel-5-simple-captcha

Simple Captcha Service Provider for laravel 5

  Sources   Download

MIT

The Requires

 

by Aziz Abdulaziz

laravel captcha laravel-5 simple-captcha