New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

johntaa/captcha

Captcha for Laravel PHP Framework L4 and L5
5,329 6

Larablocks Analysis

johntaa/captcha has no release yet to check Laravel compatibility against.

Recommendation checks

Use with care

Use with care: meets 0 of 3 checks.

  • No dated releases
  • 1 downloads a month (needs 10,000)
  • 6 GitHub stars (needs 100)

Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.

Install
composer require johntaa/captcha:dev-master
PHP:>=5.4.0
License:MIT
Last Updated:Sep 11, 2015
Links: GitHub  ·  Packagist
Maintainer: Johntaa

Captcha for Laravel 4.*

For Laravel 5 change to branch masterl5

It is just a copy of https://github.com/mewebstudio/captcha but maintained to serve Laravel framework

A simple Laravel framework service provider for including the Captcha for Laravel framework.

Preview

Preview

Installation

Note: This Script Requires GD extension to be installed

The Captcha Service Provider can be installed via Composer by requiring the mews/captcha package and setting the minimum-stability to dev (required for Laravel 4.1) in your project's composer.json.

{
    "require": {
        "laravel/framework": "4.*",
        "johntaa/captcha": "dev-master" 
    },
    "minimum-stability": "dev"
}

Update your packages with composer update or install with composer install.

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.

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

    'providers' => array(
        // ...
        'Johntaa\Captcha\CaptchaServiceProvider',
    )

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

    'aliases' => array(
        // ...
        'Captcha' => 'Johntaa\Captcha\Facades\Captcha',
    )

Configuration

To use your own settings, publish config.

$ php artisan config:publish johntaa/captcha

Example Usage


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

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

        if (Request::getMethod() == 'POST')
        {
            $rules =  array('captcha' => array('required', 'captcha'));
            $validator = Validator::make(Input::all(), $rules);
            if ($validator->fails())
            {
                echo '<p style="color: #ff0000;">Incorrect!</p>';
            }
            else
            {
                echo '<p style="color: #00ff30;">Matched :)</p>';
            }
        }

        $content = Form::open(array(URL::to(Request::segment(1))));
        $content .= '<p>' . HTML::image(Captcha::img(), 'Captcha image') . '</p>';
        $content .= '<p>' . Form::text('captcha') . '</p>';
        $content .= '<p>' . Form::submit('Check') . '</p>';
        $content .= '<p>' . Form::close() . '</p>';
        return $content;

    });

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660