Exemple #1
0
<?php

Autoloader::map(array('CoolCaptcha\\Captcha' => __DIR__ . DS . 'classes' . DS . 'captcha.php'));
Laravel\Validator::register('coolcaptcha', function ($attribute, $value, $parameters) {
    return CoolCaptcha\Captcha::check($value);
});
Exemple #2
0
<?php

Autoloader::map(array('Recaptcha\\Recaptcha' => __DIR__ . DS . 'recaptcha' . EXT));
Laravel\Validator::register('recaptcha', function ($attribute, $value, $parameters) {
    $recaptcha = Recaptcha\Recaptcha::recaptcha_check_answer($parameters[0], Laravel\Request::ip(), Laravel\Input::get('recaptcha_challenge_field'), $value);
    return $recaptcha->is_valid;
});