PHPackages                             andreibu/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. andreibu/laravel\_captcha

ActivePackage[Validation &amp; Sanitization](/categories/validation)

andreibu/laravel\_captcha
=========================

CAPTCHA For Laravel.

1.6.6(9y ago)1112MITPHPPHP &gt;=5.3.23

Since Feb 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/AndreiBu/laravel_captcha)[ Packagist](https://packagist.org/packages/andreibu/laravel_captcha)[ RSS](/packages/andreibu-laravel-captcha/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (14)Used By (0)

CAPTCHA
=======

[](#captcha)

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

[](#installation)

```
composer require andreibu/laravel_captcha

```

Laravel 5
---------

[](#laravel-5)

### Setup

[](#setup)

Add ServiceProvider to the providers array in `config/app.php`.

```

   'providers' => [
    ...
	AndreiBu\laravel_captcha\CaptchaServiceProvider::class,

	],

   'aliases' => [
    ...

	'Captcha' => AndreiBu\laravel_captcha\Facades\Captcha::class,
	],

```

Add Route to reload captcha `routes/web.php`.

```
    Route::get('/captcha/{key?}', function($key='') {
        $json=array('img'=>Captcha::img($key),'key'=>Captcha::md5());
        return json_encode($json);
    });

```

### Configuration

[](#configuration)

you must copy in `/public/fonts/` ttf font and specify its path in the configuration `CAPTCHA_FONT`

(optional) Add key in .env file (without brackets):

```
    CAPTCHA_MIN=[0-999 999 999]
    CAPTCHA_MAX=[0-999 999 999]
    CAPTCHA_WIDTH=[0-1000]
    CAPTCHA_HEIGHT=[0-1000]
    CAPTCHA_TIME=[60-3600]
    CAPTCHA_GARBAGE=[0-100]
    CAPTCHA_REDRAW=[1-10]
    CAPTCHA_FONT='/fonts/times.ttf'
```

### Usage

[](#usage)

##### create CAPTCHA cod

[](#create-captcha-cod)

```
          {!! Captcha::create_cod(); !!}
          or
          {!! app('captcha')->create_cod(); !!}
```

##### display CAPTCHA

[](#display-captcha)

```
        {!! Captcha::create_cod(); !!}

		{!! Captcha::img(); !!}
```

##### display CAPTCHA + reload

[](#display-captcha--reload)

```

                                @if ($errors->has('captcha_cod'))

                                        {{ $errors->first('captcha_cod') }}

                                @endif
                     		{!! Captcha::create_cod(); !!}

                            {!! Captcha::img(); !!}
                            reload

                            function captcha_redraw(key){
                                var key=$('.pwd_reset_captcha input[name=captcha_md5]').val();
                                $.get('/captcha/'+key,'', function (data){
                                    try{
                                       var json=JSON.parse(data);
                                       $('.pwd_reset_captcha img.captcha').replaceWith(json.img);
                                       if(json.key!=''){$('.pwd_reset_captcha input[name=captcha_md5]').val(json.key);}
                                    }
                                    catch(e){console.log(e);}
                                });
                            }

```

##### Validation

[](#validation)

Add `'captcha_cod' => 'required|captcha'` to rules array.

```
$validate = Validator::make(Input::all(), [
	'captcha_cod' => 'required|captcha'
]);
```

Contribute
----------

[](#contribute)

[https://github.com/AndreiBu/laravel\_captcha/pulls](https://github.com/AndreiBu/laravel_captcha/pulls)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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 ~1 days

Total

12

Last Release

3407d ago

Major Versions

0.2 → 1.22017-02-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16398626?v=4)[Andrei Buldakov](/maintainers/AndreiBu)[@AndreiBu](https://github.com/AndreiBu)

---

Top Contributors

[![AndreiBu](https://avatars.githubusercontent.com/u/16398626?v=4)](https://github.com/AndreiBu "AndreiBu (1 commits)")

---

Tags

laravelcaptchalaravel5

### Embed Badge

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

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

###  Alternatives

[schuppo/password-strength

This package provides a validator for ensuring strong passwords in Laravel 4 applications.

1432.7M1](/packages/schuppo-password-strength)[elic-dev/laravel-math-captcha

A simple math captcha for Laravel form validation.

1258.5k](/packages/elic-dev-laravel-math-captcha)[bllim/laravalid

This package makes validation rules defined in laravel work client-side by converting to html/js plugins such as jquery validation. It also allows to use laravel validation messages so you can show same messages for both sides.

5915.3k](/packages/bllim-laravalid)[mohsen/captcha

A simple captcha for laravel 4

125.2k](/packages/mohsen-captcha)

PHPackages © 2026

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