neverbehave/hcaptcha

Wrapper of hcaptcha

0.0.3 2021-08-05 21:38 UTC

This package is auto-updated.

Last update: 2024-11-29 06:03:55 UTC


README

Server side verification package

Quick Start

  1. Require Package
composer require neverbehave/hcaptcha
  1. Create an instance
$hcaptcha = new neverbehave\Hcaptcha('Your API KEY');

// Generate Challenge
// Instance of HcaptchaResponse
$client_challenge1 = $hcaptcha->challenge('Response');
$client_challenge2 = $hcaptcha->challenge('Another Response', 'Client IP');

// Read Result
if ($client_challenge1->isSuccess()) {
    // Do Something
} else {
    // Read Error
    $client_challenge1->getErrors();
}

// Get Raw Response 
$client_challenge2->getRaw();

Reference

https://docs.hcaptcha.com/