PHP code example of astritzeqiri / g-recaptcha

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

    

astritzeqiri / g-recaptcha example snippets


return [
	'enabled' => env("GRECAPTCHA_ENABLED", true),
	'site_key' => env("GRECAPTCHA_KEY"),
	'secret_key' => env("GRECAPTCHA_SECRET"),
];

'providers' => array(
    // ...
    AstritZeqiri\GRecaptcha\GRecaptchaServiceProvider::class
)

'aliases' => array(
    // ...
    'GRecaptcha' => AstritZeqiri\GRecaptcha\GRecaptcha::class,
)

// in blade.php files
{!! \GRecaptcha::renderScripts() !!}

// or in .php files
 echo GRecaptcha::renderScripts(); 

// by default it echo's it out
GRecaptcha::render();

// if you want to save the html in a variable you call 
$grecaptchaHtml = GRecaptcha::render([], false);

$grecaptcha = GRecaptcha::generate();

// to render it you call
$grecaptcha->renderHtml();

// if you dont want it to be rendered but store the html you call
$grecaptchaHtml = $grecaptcha->build();

$validator = Validator::make($inputs,
    ['g-recaptcha-response' => '

$ php artisan vendor:publish