PHPackages                             chenhakim/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. chenhakim/captcha

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

chenhakim/captcha
=================

Captcha Package for Laravel 5/6/7/8

022PHP

Since Jan 20Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Captcha for Laravel 5|6|7|8
===========================

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

A simple [Laravel 5|6|7|8](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 chenhakim/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' => [
        // ...
        'Captcha\Captcha\CaptchaServiceProvider',
    ]
```

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

```
    'aliases' => [
        // ...
        'Captcha' => '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/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)

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

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

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://www.gravatar.com/avatar/5c68729735077806dd9400fdf7b2af3ed37d89acf25321fd7f06c832323f33c9?d=identicon)[chenhakim](/maintainers/chenhakim)

---

Top Contributors

[![meituheheda](https://avatars.githubusercontent.com/u/155143247?v=4)](https://github.com/meituheheda "meituheheda (10 commits)")

### Embed Badge

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

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

###  Alternatives

[tg/tgwebvalid

An easy way to validate Telegram Login Widget and Telegram Mini App users on your website using PHP

6827.5k1](/packages/tg-tgwebvalid)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)[kissdigital-com/apple-sign-in-client-secret-generator

PHP package for generating 'client secret' for Sign In with Apple

2125.5k](/packages/kissdigital-com-apple-sign-in-client-secret-generator)[denniseilander/laravel-passport-scopes-restriction

Restrict scopes for different Laravel Passport clients.

1636.3k](/packages/denniseilander-laravel-passport-scopes-restriction)

PHPackages © 2026

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