PHPackages                             souravmsh/easy-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. [Image &amp; Media](/categories/media)
4. /
5. souravmsh/easy-captcha

ActiveLibrary[Image &amp; Media](/categories/media)

souravmsh/easy-captcha
======================

A pure image-based CAPTCHA package for Laravel

1.2.0(yesterday)020↑1550%MITPHPPHP ^7.2.5|^8.0CI passing

Since Apr 6Pushed yesterdayCompare

[ Source](https://github.com/souravmsh/easy-captcha)[ Packagist](https://packagist.org/packages/souravmsh/easy-captcha)[ Docs](https://github.com/souravmsh/easy-captcha)[ RSS](/packages/souravmsh-easy-captcha/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Easy Captcha
============

[](#easy-captcha)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b0b374b15922a6a1628610f4347e4f21b11d09930b211c244408b517d25fa5d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f757261766d73682f656173792d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/souravmsh/easy-captcha)[![Total Downloads](https://camo.githubusercontent.com/6dd8df34039ca0b8d26a22ba7c48c7363700e8687ad96c32915c07c0af3edf0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f757261766d73682f656173792d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/souravmsh/easy-captcha)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

An easy, lightweight, pure image-based CAPTCHA package for Laravel (Requires ext-gd). No third-party APIs needed for local generation. The CAPTCHA generates standard image data dynamically directly via PHP. Also supports **Google reCAPTCHA v2/v3** and **Cloudflare Turnstile** (Latest!).

**[View Landing Page &amp; Documentation](https://souravmsh.github.io/easy-captcha/)**

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

[](#installation)

```
composer require souravmsh/easy-captcha
```

The package is auto-discovered by Laravel. If auto-discovery is disabled, register the service provider manually (optional):

**Laravel 11+** — in `bootstrap/providers.php`:

```
return [
    // ...
    Souravmsh\EasyCaptcha\EasyCaptchaServiceProvider::class,
];
```

**Laravel 7–10** — in `config/app.php` under `providers`:

```
'providers' => [
    // ...
    Souravmsh\EasyCaptcha\EasyCaptchaServiceProvider::class,
],
```

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

[](#configuration)

Optionally publish the configuration file to customize CAPTCHA sizes and colors:

```
php artisan vendor:publish --tag=easy-captcha-config
```

To overwrite an already published config:

```
php artisan vendor:publish --tag=easy-captcha-config --force
```

You can change the CAPTCHA type in `config/easy_captcha.php`, or easily turn the CAPTCHA off completely for local development/testing using your `.env` file:

```
EASY_CAPTCHA_ENABLED=false
EASY_CAPTCHA_TYPE=math
EASY_CAPTCHA_FONT_PATH=UbuntuMono-Regular
```

### Bundled Fonts (Latest!)

[](#bundled-fonts-latest)

The package now comes with built-in fonts that you can use by name in your `.env` or config:

- `IndieFlower` (Default - Handwritten)
- `SpecialElite` (Typewriter style)
- `CourierPrime` (Monospace)
- `Ubuntu-Bold`
- `UbuntuMono-Regular`
- `Ubuntu-Italic`

Supported types:

- `'random'` (Alphanumeric)
- `'math'` (e.g., 5 + 3, validation checks for 8)
- `'alphabet'` (Letters only)
- `'number'` (Numbers only)
- `'google'` (Google reCAPTCHA v2/v3 support!)
- `'turnstile'` (Cloudflare Turnstile support! - Latest)

### Setting up Google reCAPTCHA

[](#setting-up-google-recaptcha)

If you choose `google` as the CAPTCHA type, our blade directive and validation facade will automatically hook into Google's APIs. If you want to use older version like v3 then spefify in config file, default is v3. Add your site/secret keys inside the `.env`:

```
EASY_CAPTCHA_TYPE=google
EASY_CAPTCHA_GOOGLE_API_VERSION=3
EASY_CAPTCHA_GOOGLE_SITE_KEY=your-site-key-here
EASY_CAPTCHA_GOOGLE_SECRET_KEY=your-secret-key-here
```

### Setting up Cloudflare Turnstile (Latest!)

[](#setting-up-cloudflare-turnstile-latest)

If you choose `turnstile` as the CAPTCHA type, our blade directive and validation facade will automatically hook into Cloudflare's APIs. Add your site/secret keys inside the `.env`:

```
EASY_CAPTCHA_TYPE=turnstile
EASY_CAPTCHA_TURNSTILE_SITE_KEY=your-site-key-here
EASY_CAPTCHA_TURNSTILE_SECRET_KEY=your-secret-key-here
```

Usage
-----

[](#usage)

### Displaying the CAPTCHA image

[](#displaying-the-captcha-image)

In your Blade form, you can render an image tag manually:

```
@easyCaptcha
```

This simple blade directive handles showing the `` and attaching a neat `[Reload]` button next to it!

Or you can use the Facade manually if you need more control:

```
{!! \Souravmsh\EasyCaptcha\Facades\EasyCaptcha::img(['class' => 'my-captcha-class']) !!}
```

### Validating the CAPTCHA

[](#validating-the-captcha)

Once the form is submitted, validate the user's input:

```
use Illuminate\Http\Request;
use Souravmsh\EasyCaptcha\Rules\Captcha;

public function submit(Request $request) {
    // Option 1: String rule (Standard)
    $request->validate([
        'captcha' => 'required|easyCaptcha'
    ]);

    // Option 2: Class-based rule (More robust)
    $request->validate([
        'captcha' => ['required', new Captcha]
    ]);

    // Option 3: Alias rule (More robust)
    $request->validate([
        'captcha' => 'required|captcha'
    ]);

    // Option 4: Alias rule (More robust)
    $request->validate([
        'captcha' => 'required|easy_captcha'
    ]);

    // Success!
    return "Valid CAPTCHA!";
}
```

Support
-------

[](#support)

Laravel versions 7, 8, 9, 10, 11, 12, 13 are fully supported. PHP 7.2.5+ &amp; 8.0+ are required along with `ext-gd`.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance100

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.6% 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 ~0 days

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae67321af4f111005e4abe6a7218e79dcef720c794cd1bd73b0a36f41c515d1f?d=identicon)[souravmsh](/maintainers/souravmsh)

---

Top Contributors

[![souravqfin](https://avatars.githubusercontent.com/u/156651351?v=4)](https://github.com/souravqfin "souravqfin (31 commits)")[![souravmsh](https://avatars.githubusercontent.com/u/12506579?v=4)](https://github.com/souravmsh "souravmsh (7 commits)")

---

Tags

laravelvalidationgooglesecurityimagecaptchaanti-botturnstilehcaptcha

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M100](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)

PHPackages © 2026

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