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 1mo 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 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

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

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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