dev-master
9999999-devA simple captcha for Laravel 4
GPL-2.0
The Requires
- php >=5.3.0
- illuminate/support 4.0.x
by wikichu
Wallogit.com
2017 © Pedro Peláez
A simple captcha for Laravel 4
Composer.json:, (*1)
require: "wikichua/captcha": "dev-master", (*2)
Provider:, (*3)
'Wikichua\Captcha\CaptchaServiceProvider',, (*4)
Alias:, (*5)
'Captcha' => 'Wikichua\Captcha\Facades\Captcha',, (*6)
Sample usage:, (*7)
Route::any('test',function() { if (Request::getMethod() == 'POST') { $rules = array('thecaptcha' => array('required', 'captcha')); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { echo ', (*8)
Captcha failed, (*9)
'; } else { echo ', (*10)
Captcha passed, (*11)
'; } }, (*12)
$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;
});, (*13)
A simple captcha for Laravel 4
GPL-2.0