PHPackages                             fetzi/kirby-uniform-recaptcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. fetzi/kirby-uniform-recaptcha

AbandonedArchivedLibrary[Security](/categories/security)

fetzi/kirby-uniform-recaptcha
=============================

ReCAPTCHA guard for the Uniform plugin

v1.0.0(8y ago)12261MITPHP

Since Nov 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/fetzi/kirby-uniform-recaptcha)[ Packagist](https://packagist.org/packages/fetzi/kirby-uniform-recaptcha)[ RSS](/packages/fetzi-kirby-uniform-recaptcha/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

kirby-uniform-recaptcha
=======================

[](#kirby-uniform-recaptcha)

An extension to the Kirby 2 plugin [Uniform](https://github.com/mzur/kirby-uniform) (v3) to add the Google reCAPTCHA guard.

Installation
------------

[](#installation)

### Kirby CLI

[](#kirby-cli)

Get the [Kirby CLI](https://github.com/getkirby/cli) and run `kirby plugin:install fetzi/kirby-uniform-recaptcha`.

### Traditional

[](#traditional)

[Download](https://github.com/fetzi/kirby-uniform-recaptcha/archive/master.zip) the repository and extract it to `site/plugins/uniform-recaptcha`.

### Composer

[](#composer)

Run `composer require fetzi/kirby-uniform-recaptcha`. Then add the second `require` to the `index.php` like this:

```
// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');
require 'vendor'.DS.'autoload.php';
```

Be sure to include the new `vendor` directory in your deployment.

Configuration
-------------

[](#configuration)

Define the mandatory config settings:

1. `c::set('uniform-recaptcha-sitekey', 'YOUR RECAPTCHA SITEKEY');`
2. `c::set('uniform-recaptcha-secret', 'YOUR RECAPTCHA SECRET');`

Usage
-----

[](#usage)

You can use the `recaptchaGuard` in your controllers form definition:

```
$form = new Form(/* ... */);

if (r::is('POST')) {
    $form->recaptchaGuard()
        ->emailAction(/* ... */);
}
```

To embed the recaptcha field into your template simply call ``

The plugin needs the recaptcha Javascript File provided by Google. You can either include the [JavaScript file](https://www.google.com/recaptcha/api.js) directly into your page or by calling the method `embed_recaptcha_js()` in your template.

**Example**

```
 class="erroneous" name="name" type="text" value="
