DearMadMan / Captcha by DearMadMan

Captcha for Laravel 5
76
0
2
Package Data
Maintainer Username: DearMadMan
Maintainer Contact: 2034906607@qq.com (dearmadman)
Package Create Date: 2015-03-25
Package Last Update: 2016-08-12
Language: PHP
License: MIT
Last Refreshed: 2024-04-30 15:05:47
Package Statistics
Total Downloads: 76
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

Captcha

Simple Captcha for laravel 5

Preview

![alt Captcha](https://raw.githubusercontent.com/DearMadMan/Captcha/master/preview.jpg)

Installation

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

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

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.

Find the providers key in app/config/app.php and register the Captcha Service Provider.

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

Example Usage


    // [your site path]/app/routes.php

   Route::get('captcha',function(Captcha $captcha){

    $captcha->InitFromArray([
        'width'=>100,
        'height'=>50,
        'chinese'=>true,
        'char_num'=>5,
        'line_x'=>3,
        'line_y'=>2,
        'pixel'=>300
    ]);
    return $captcha->PushImage();

	});

    Route::get('check',function(Captcha $captcha){

    return $captcha->check('板迷的细财')?'ok':'wrong';
    
	});

^_^