PHP code example of josiasmontag / laravel-recaptchav3

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

    

josiasmontag / laravel-recaptchav3 example snippets


{!! RecaptchaV3::initJs() !!}

$validate = Validator::make(Input::all(), [
	'g-recaptcha-response' => '

// Import the facade class
use Lunaweb\RecaptchaV3\Facades\RecaptchaV3;
//  RecaptchaV3::verify($token, $action)
$score = RecaptchaV3::verify($request->get('g-recaptcha-response'), 'register')
if($score > 0.7) {
    // go
} elseif($score > 0.3) {
    // 

'custom' => [
    'g-recaptcha-response' => [
        'recaptchav3' => 'Captcha error message',
    ],
],

RecaptchaV3::shouldReceive('verify')
    ->once()
    ->andReturn(1.0);


php artisan vendor:publish --provider="Lunaweb\RecaptchaV3\Providers\RecaptchaV3ServiceProvider"