PHPackages                             zerosdev/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zerosdev/laravel-captcha

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zerosdev/laravel-captcha
========================

Captcha Generator for Laravel Framework

2568↓100%PHPCI failing

Since Jan 25Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Captcha
===============

[](#laravel-captcha)

Laravel Captcha Generator

Requirements
------------

[](#requirements)

- PHP 5.6+
- Laravel Framework 5.2+
- GD Library enabled

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

[](#installation)

- Run

```
composer require zerosdev/laravel-captcha:dev-master
```

- Add this code to your **config/app.php** in providers array

```
ZerosDev\LaravelCaptcha\ServiceProvider::class,
```

- Add this code to your **config/app.php** in aliases array

```
'Captcha' => ZerosDev\LaravelCaptcha\Facade::class,
```

- Run

```
composer dump-autoload
```

- Run

```
php artisan vendor:publish --provider="ZerosDev\LaravelCaptcha\ServiceProvider"
```

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

[](#configuration)

Open your **config/captcha.php** and adjust the setting. Optionally, you can adjust some captcha setting on-the-fly with available methods below:

#### chars(String)

[](#charsstring)

Set the characters that will be used as captcha text

#### size(Integer width, Integer height)

[](#sizeinteger-width-integer-height)

Set the captcha image width and height in pixel (px)

#### length(Integer)

[](#lengthinteger)

Set the captcha character length

Generation Example
------------------

[](#generation-example)

```

// Import from root class (Captcha Facade)
use Captcha;

// generate captcha
$captcha = Captcha::chars('123456789ABCDEFGHIJKLMNPQRSTUVWXYZ')->length(4)->size(120, 40)->generate();

// get captcha id
$id = $captcha->id();
// return random generation id

// print html hidden form field, used in blade template
{{ $captcha->form_field() }}
// return:

// get base64 image
$image = $captcha->image();
// return data:image/png; base64,XXXXXXXXXXXXXX

// print html image, used in blade template
{{ $captcha->html_image(['onclick' => 'jsFunction()', 'style' => 'border:1px solid #ddd']) }}
// return:

```

Validation
----------

[](#validation)

```

// Import from root class (Captcha Facade)
use Captcha;

// validate captcha
// $captchaId = Captcha generation id, $captcha->id()
// $captchaText = Captcha input from client request

if( Captcha::validate($captchaId, $captchaText) )
{
    // Valid
}
else
{
    // Invalid
}

```

Advise
------

[](#advise)

It is recommended to avoid using the "0" (zero) and "O" characters in captcha to avoid being ambiguous

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33526722?v=4)[Rony Wisnu Wardana](/maintainers/ZerosDev)[@zerosdev](https://github.com/zerosdev)

---

Top Contributors

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

---

Tags

captchalaravelphpphp-captcha-generator

### Embed Badge

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

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

###  Alternatives

[adigital/cookie-consent-banner

Add a configurable cookie consent banner to the website.

1150.7k](/packages/adigital-cookie-consent-banner)[michaels/data-manager

Simple data manager for nested data, dot notation array access, extendability, and container interoperability.

121.9k2](/packages/michaels-data-manager)

PHPackages © 2026

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