PHP code example of larsnieuwenhuizen / no-captcha

1. Go to this page and download the library: Download larsnieuwenhuizen/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/ */

    

larsnieuwenhuizen / 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']) !!}

$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 '



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();
}