An open API service indexing awesome lists of open source software.

https://github.com/kiddivouchers/hcaptcha

PHP hCaptcha library
https://github.com/kiddivouchers/hcaptcha

library php

Last synced: 3 months ago
JSON representation

PHP hCaptcha library

Awesome Lists containing this project

README

          

hCaptcha API Client
===================

Usage
-----

### Basic

With `php-http/discovery` installed this package will be leveraged to attempt to
use the most appropriate implementations of [PSR-7][] and [PSR-18][].

```sh
composer require widerplan/hcaptcha php-http/discovery
```

```php
verify($_POST['h-captcha-response'], getenv('HCAPTCHA_SITE_KEY'));

if ($result->success) {
// Perform protected action...
}
```

### With custom components

Instead of relying on the automatic discovery you can wire up your chosen implementations.

```sh
composer require widerplan/hcaptcha symfony/http-client slim/psr7
```

```php
verify($_POST['h-captcha-response'], getenv('HCAPTCHA_SITE_KEY'));

if ($result->success) {
// Perform protected action...
}
```

[PSR-7]: https://www.php-fig.org/psr/psr-7/
[PSR-18]: https://www.php-fig.org/psr/psr-18/