PHP code example of guiliredu / laravel-simple-recaptcha

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

    

guiliredu / laravel-simple-recaptcha example snippets


@

@

@

class StoreController extends Controller 
{
    public function store(Request $request)
    {
        $this->validate($request,
            ['g-recaptcha-response' => 'recaptcha'],
            ['recaptcha' => trans('recaptcha::validation.invalid')]
        );
    }
}

use Guiliredu\LaravelSimpleRecaptcha\Recaptcha;
...

dd(Recaptcha::isRequestValid($request)); // true|false
dd(Recaptcha::isValid($request->input('g-recaptcha-response'))); // true|false
bash
php artisan vendor:publish --provider=Guiliredu\LaravelSimpleRecaptcha\RecaptchaServiceProvider