PHPackages                             latrell/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. [Security](/categories/security)
4. /
5. latrell/captcha

ActiveLibrary[Security](/categories/security)

latrell/captcha
===============

Captcha Package for Laravel 5

1.4(8y ago)87.6k131MITPHPPHP &gt;=5.4.0

Since Apr 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Latrell/Captcha)[ Packagist](https://packagist.org/packages/latrell/captcha)[ RSS](/packages/latrell-captcha/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (2)Versions (7)Used By (1)

For Laravel 4, please use the [1.1 branch](https://github.com/Latrell/Captcha/releases/tag/1.1)!

Captcha for Laravel 5
=====================

[](#captcha-for-laravel-5)

A simple [Laravel 5](http://laravel.com/) service provider for including the [Captcha for Laravel 5](https://github.com/Gregwar/Captcha).

This library is not maintained for 3rd party use.

Preview
-------

[](#preview)

[![Captchas examples](https://camo.githubusercontent.com/d2ec7ccc16dacc36732ff2c6bad51df1bad2428b/687474703a2f2f677265677761722e636f6d2f63617074636861732e706e67)](https://camo.githubusercontent.com/d2ec7ccc16dacc36732ff2c6bad51df1bad2428b/687474703a2f2f677265677761722e636f6d2f63617074636861732e706e67)

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

[](#installation)

```
composer require latrell/captcha dev-master

```

Usage
-----

[](#usage)

To use the Captcha Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this (only for Laravel 5.4 or below).

Find the `providers` key in `config/app.php` and register the Captcha Service Provider.

```
    'providers' => [
        // ...
        'Latrell\Captcha\CaptchaServiceProvider',
    ]
```

Find the `aliases` key in `config/app.php`.

```
    'aliases' => [
        // ...
        'Captcha' => 'Latrell\Captcha\Facades\Captcha',
    ]
```

Custom error messages. Add key `captcha` to `resources/lang/[local]/validation.php`

```
return [
	// ...
	'captcha' => '图片验证码不正确。',
];
```

Then publish the config file with `php artisan vendor:publish`. This will add the file `config/latrell-captcha.php`. This config file is the primary way you interact with Captcha.

Example Usage
-------------

[](#example-usage)

```
    // [your site path]/app/Http/routes.php

    Route::any('/captcha-test', function()
    {

        if (Request::getMethod() == 'POST')
        {
            $rules =  ['captcha' => 'required|captcha'];
            $validator = Validator::make(Input::all(), $rules);
            if ($validator->fails())
            {
                echo 'Incorrect!';
            }
            else
            {
                echo 'Matched :)';
            }
        }

        $content = Form::open(array(URL::to(Request::segment(1))));
        $content .= '' . HTML::image(Captcha::url()) . '';
        $content .= '' . Form::text('captcha') . '';
        $content .= '' . Form::submit('Check') . '';
        $content .= '' . Form::close() . '';
        return $content;

    });
```

Links
-----

[](#links)

- [L5 Captcha on Github](https://github.com/latrell/captcha)
- [L5 Captcha on Packagist](https://packagist.org/packages/Latrell/captcha)
- [Captcha for Gregwar](https://github.com/Gregwar/Captcha)
- [License](http://www.opensource.org/licenses/mit-license.php)
- [Laravel website](http://laravel.com)
- [MeWebStudio website](http://latrell.me)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

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

Recently: every ~310 days

Total

6

Last Release

3164d ago

PHP version history (2 changes)1.0PHP &gt;=5.3.0

1.1PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![latrell](https://avatars.githubusercontent.com/u/6267962?v=4)](https://github.com/latrell "latrell (27 commits)")

---

Tags

laravellaravelsecuritycaptchalaravel 5l5captcha image

### Embed Badge

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

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

###  Alternatives

[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)

PHPackages © 2026

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