- Put this plugin into your application's
app/Plugin
folder - Create the
Config/config.php
based onConfig/config.example.php
- Add your sitekey and secret to
Config/config.php
- Load via adding
CakePlugin::load('hCaptcha');
to yourapp/Config/bootstrap.php
- In a controller displaying the challenge,
public $helpers = array('hCaptcha.hCaptcha');
- In a controller verifying the challenge,
public $components = array('hCaptcha.hCaptcha');
- Inside a $this->Form in your view template, use
echo $this->hCaptcha->challenge();
- In the controller receiving the request from the above form, call
$this->hCaptcha->verify($this->request->data)
- Show an error or throw an exception based on the
verify()
result