wikichua/captcha

A simple captcha for Laravel 4

dev-master 2013-06-19 08:51 UTC

This package is auto-updated.

Last update: 2024-11-24 14:50:02 UTC


README

Composer.json:

require: "wikichua/captcha": "dev-master"

Provider:

'Wikichua\Captcha\CaptchaServiceProvider',

Alias:

'Captcha' => 'Wikichua\Captcha\Facades\Captcha',

Sample usage:

Route::any('test',function() { if (Request::getMethod() == 'POST') { $rules = array('thecaptcha' => array('required', 'captcha')); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { echo '

Captcha failed

'; } else { echo '

Captcha passed

'; } }

$content = Form::open(['to'=>URL::to(Request::segment(1))]);
$content .= '<p>' . Captcha::imgUrl(['class'=>'testing']) . '</p>';
$content .= '<p>' . Form::text('thecaptcha') . '</p>';
$content .= '<p>' . Form::submit('Check') . '</p>';
$content .= Form::close();
return $content;

});