PHP code example of zbrettonye / geetest

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

    

zbrettonye / geetest example snippets


	ZBrettonYe\Geetest\GeetestServiceProvider::class,
	

     'Geetest' => ZBrettonYe\Geetest\Facades\Geetest::class,
     

	{!! Geetest::render() !!}
	

	$this->validate($request, [
		'geetest_challenge' => '')
	]);
	



namespace App\Components;

/**
 * Class CaptchaVerify
 *
 * @package App\Components
 */

Class CaptchaVerify 
{
    public static function geetestCaptchaGetConfig() 
    {
        return [
            "geetest_id" => Helpers::systemConfig()["geetest_id"], // 后台获取 id
            "geetest_key" => Helpers::systemConfig()["geetest_key"] // 后台获取 key
        ];
    }
}

shell
	php artisan vendor:publish --provider='ZBrettonYe\Geetest\GeetestServiceProvider'