PHP code example of luppakorva / no-captcha
1. Go to this page and download the library: Download luppakorva/no-captcha library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
luppakorva / no-captcha example snippets
Anhskohbo\NoCaptcha\NoCaptchaServiceProvider::class,
'NoCaptcha' => Anhskohbo\NoCaptcha\Facades\NoCaptcha::class,
{!! NoCaptcha::renderJs() !!}
{!! NoCaptcha::renderJs('fr', true, 'recaptchaCallback') !!}
{!! NoCaptcha::display() !!}
{!! NoCaptcha::display(['data-theme' => 'dark']) !!}
{!! NoCaptcha::displaySubmit('my-form-id', 'submit now!', ['data-theme' => 'dark']) !!}
$validate = Validator::make(Input::all(), [
'g-recaptcha-response' => '
'custom' => [
'g-recaptcha-response' => [
'r contact site admin.',
],
],
@if ($errors->has('g-recaptcha-response'))
<span class="help-block">
<strong>{{ $errors->first('g-recaptcha-response') }}</strong>
</span>
@endif
// prevent validation error on captcha
NoCaptcha::shouldReceive('verifyResponse')
->once()
->andReturn(true);
// provide hidden input for your '
// prevent validation error on captcha
NoCaptcha::shouldReceive('verifyResponse')
->once()
->andReturn(true);
// POST request, with request body including g-recaptcha-response
$response = $this->json('POST', '/register', [
'g-recaptcha-response' => '1',
'name' => 'John',
'email' => '[email protected] ',
'password' => '123456',
'password_confirmation' => '123456',
]);
et = 'CAPTCHA-SECRET';
$sitekey = 'CAPTCHA-SITEKEY';
$captcha = new \Anhskohbo\NoCaptcha\NoCaptcha($secret, $sitekey);
if (! empty($_POST)) {
var_dump($captcha->verifyResponse($_POST['g-recaptcha-response']));
exit();
}
ssh
php artisan vendor:publish --provider="Anhskohbo\NoCaptcha\NoCaptchaServiceProvider"