PHP code example of kilofox / hyperf-captcha

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

    

kilofox / hyperf-captcha example snippets


$ php bin/hyperf.php vendor:publish kilofox/hyperf-captcha

$key = $this->request->query('key');
$captcha = $captchaFactory->create($key);

return $captcha->render();

$key = $this->request->input('key', '');
$captcha = $this->request->input('captcha', '');

$captchaFactory->validate($key, $captcha);