PHPackages                             origami/captcha - 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. origami/captcha

ActiveLibrary

origami/captcha
===============

Simple Google Recaptcha integration for Laravel projects

3.1.0(2mo ago)17.9k↓100%MITPHPPHP ^8.1

Since Sep 20Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/papertank/origami-captcha)[ Packagist](https://packagist.org/packages/origami/captcha)[ RSS](/packages/origami-captcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (11)Used By (0)

Origami Catpcha - Laravel Captcha Package
=========================================

[](#origami-catpcha---laravel-captcha-package)

This package adds a validation rule and controller trait for easier integration with Google Recaptcha

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

[](#installation)

Install this package through Composer.

```
composer require origami/captcha

```

### Requirements

[](#requirements)

This package is designed to work with Laravel &gt;= 10 currently. If you require 5.8 support, use version 1. If you require 6-7 support use version 2.

### Setup

[](#setup)

1. Signup for a Google Recaptcha account at
2. You should add a recatpcha section to your `config/services.php` file:

```

    'recaptcha' => [
        'key' => env('RECAPTCHA_KEY'),
        'secret' => env('RECAPTCHA_SECRET'),
    ],
```

3. Update your `.env` file with the key and secret:

```
RECAPTCHA_KEY=
RECAPTCHA_SECRET=

```

4. Add a language line to your validation file(s), e.g. `resources/lang/en/validation.php`

```

    'recaptcha' => 'The reCAPTCHA check was invalid',

```

Usage
-----

[](#usage)

### Validator

[](#validator)

```
$validator = Validator::make($request->all(), [
    'recaptcha' => [new Origami\Captcha\Rules\Recaptcha],
]);
```

### Controller Validation

[](#controller-validation)

(Assuming your Controller has the `ValidatesRequests` trait)

```
class Contact extends Controller
{
    public function store(Request $request)
    {
        $this->validate($request, [
            'recatpcha' => [new Origami\Captcha\Rules\Recaptcha]
        ]);
    }
}
```

### Changing Google secret

[](#changing-google-secret)

If you have multiple Recaptcha secrets (e.g. for different versions), you can customise in the rule params. Otherwise it will default to `config('services.recaptcha.secret')`

```
class Contact extends Controller
{
    public function store(Request $request)
    {
        $this->validate($request, [
            'recatpcha' => [new Origami\Captcha\Rules\Recaptcha(secret: '123')]
        ]);
    }
}
```

### Controller with ValidatesCaptcha Trait

[](#controller-with-validatescaptcha-trait)

```
use Origami\Captcha\ValidatesCaptcha;

class Contact extends Controller
{
    use ValidatesCaptcha;

    public function store(Request $request)
    {
        $this->validateRecaptcha($request);

        // The above will throw a ValidationException when the recaptcha fails.
    }

}
```

Blade Helpers
-------------

[](#blade-helpers)

This packages registers two Blade helpers:

`@recaptchaField` is the equivalent of:

```

```

`@recaptchaScript` is the equivalent of:

```

```

Upgrading
---------

[](#upgrading)

### From v2 to v3

[](#from-v2-to-v3)

Version 3 was created to add Laravel 11.x support and drop support for Laravel versions before 10.x. This is a breaking change as the package now relies on [Rule Objects](https://laravel.com/docs/10.x/validation#using-rule-objects).

```
// Before
$validator = Validator::make($request->all(), [
    'recaptcha' => 'recaptcha',
]);

// After
$validator = Validator::make($request->all(), [
    'recaptcha' => [new Origami\Captcha\Rules\Recaptcha],
]);
```

The `ValidatesCaptcha` trait `validateReCaptcha` method has been renamed `validateRecaptcha`

Author
------

[](#author)

- [David Rushton](https://github.com/davidrushton)
- [Papertank Limited](http://papertank.com)

License
-------

[](#license)

[MIT License](http://github.com/papertank/origami-captcha/blob/master/LICENSE)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance86

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~340 days

Recently: every ~366 days

Total

9

Last Release

66d ago

Major Versions

1.1.0 → 2.0.02020-09-13

2.x-dev → 3.0.02024-05-28

PHP version history (4 changes)1.0.0PHP &gt;=5.6

2.0.0PHP ^7.2

2.1.0PHP ^7.2|^8.0.2

3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b1eb2c68ae9c43fc61ae8aa21aabaf932fcb1fd2372e77db8e7800d38cdf3d2?d=identicon)[papertank](/maintainers/papertank)

---

Top Contributors

[![davidrushton](https://avatars.githubusercontent.com/u/4039772?v=4)](https://github.com/davidrushton "davidrushton (11 commits)")

### Embed Badge

![Health badge](/badges/origami-captcha/health.svg)

```
[![Health](https://phpackages.com/badges/origami-captcha/health.svg)](https://phpackages.com/packages/origami-captcha)
```

###  Alternatives

[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M597](/packages/laravel-ui)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[watson/validating

Eloquent model validating trait.

9723.3M46](/packages/watson-validating)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
