A CakePHP plugin to integrate captchas.

Installs: 3 468

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 1

Open Issues: 3


1.0.0-beta 2020-01-09 11:53 UTC

This package is auto-updated.

Last update: 2020-01-09 13:10:39 UTC


Build Status Coverage Status Minimum PHP Version License Total Downloads Coding Standards

Allows any type of image-based captchas for your forms.

A CakePHP plugin to

  • Easily integrate captchas in your CakePHP application.

This plugin requires CakePHP 3.7+. See version map for details.

Whats in this plugin

  • Simple match captchas that will already do the trick without annoying "I can't read those letters".
  • Extendable interface approach to easily hook in your own engine.

Whats the gotchas

  • Dead simple, no fancy JS or alike.
  • Cross-tab safe (not session based as in overwriting each other per request).
  • Completely stand-alone plugin, no third party stuff involved/needed.




composer require dereuromark/cakephp-captcha


bin/cake plugin load Captcha -b -r

You also need to import the SQL schema. The quickest way is using Migrations plugin:

bin/cake migrations migrate -p Captcha

Basic Usage

Using the default MathEngine we can simply attach the behavior to the Table class.

Load the helper, e.g in your AppView:


Add a captcha control in your form:

echo $this->Captcha->render(['placeholder' => __('Please solve the riddle')]);

Add the behavior at runtime in your controller action:


Saving a new ad would now require a valid captcha solution.

// This would come from the form POST
$postData = [
    'title' => 'Looking for a friend',
$ad = $this->Ads->newEntity($postData);
$success = $this->Users->save($user);

For detailed documentation see Docs.