PHPackages                             elic-dev/laravel-math-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. elic-dev/laravel-math-captcha

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

elic-dev/laravel-math-captcha
=============================

A simple math captcha for Laravel form validation.

1.1.1(3y ago)1156.7k↓27.3%9[2 issues](https://github.com/elic-dev/laravel-math-captcha/issues)MITPHP

Since Apr 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/elic-dev/laravel-math-captcha)[ Packagist](https://packagist.org/packages/elic-dev/laravel-math-captcha)[ RSS](/packages/elic-dev-laravel-math-captcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

Very simple math captcha for Laravel5
=====================================

[](#very-simple-math-captcha-for-laravel5)

A simple math question (`+`,`-`,`*`) to validate user input.

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

[](#installation)

```
composer require elic-dev/laravel-math-captcha

```

### Setup Laravel &gt; 5.5

[](#setup-laravel--55)

This package supports Laravel Package Auto-Discovery.

### Setup Laravel &lt;= 5.4

[](#setup-laravel--54)

You can add the ServiceProvider to the providers array in `app/config/app.php`.

```
ElicDev\MathCaptcha\MathCaptchaServiceProvider::class,

```

Usage
-----

[](#usage)

This package only returns the question and the input. You have to position it within your labels and form classes.

```
{{ app('mathcaptcha')->label() }}
{!! app('mathcaptcha')->input() !!}
```

Display it wihtin Bootstrap as example:

```

    Please solve the following math function: {{ app('mathcaptcha')->label() }}
    {!! app('mathcaptcha')->input(['class' => 'form-control', 'id' => 'mathgroup']) !!}
    @if ($errors->has('mathcaptcha'))

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

    @endif

```

Looks like

[![MathCaptcha Bootstrap](https://raw.githubusercontent.com/elic-dev/laravel-math-captcha/master/readme_bootstrap_sample.png)](https://raw.githubusercontent.com/elic-dev/laravel-math-captcha/master/readme_bootstrap_sample.png)

#### Validation

[](#validation)

Add `'mathcaptcha' => 'required|mathcaptcha'` to rules array.

```
$this->validate($request, [
    'mathcaptcha' => 'required|mathcaptcha',
]);
```

Add corresponding translation string to your `lang/validation.php` files.

#### Reset

[](#reset)

This package does not generate a new math question for each request. Once the form has been submited without validation erros you can reset the library to force generate a new question.

```
app('mathcaptcha')->reset();
```

Configuration
-------------

[](#configuration)

### Operands, Min, Max

[](#operands-min-max)

You can adjust the available operands (`+`,`-`,`*`) and minimum or maximum randum values used. Some users might stuggle with more complex math operations.

```
php artisan vendor:publish --provider="ElicDev\MathCaptcha\MathCaptchaServiceProvider" --tag=config

```

### Display as text

[](#display-as-text)

It is possible to show the math question as text (e.g. "Four plus Five"). You can adjust a setting in the config file. This requires translations and a language files. A few languages are provided with this package.

```
php artisan vendor:publish --provider="ElicDev\MathCaptcha\MathCaptchaServiceProvider" --tag=lang

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% 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 ~274 days

Recently: every ~350 days

Total

8

Last Release

1393d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6.4

1.0.3PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bd3f6d56c3cb45c6b733e9acfe6559dcb49939a948f0ee9631567fad194b7b0?d=identicon)[elic-dev](/maintainers/elic-dev)

---

Top Contributors

[![L1lle](https://avatars.githubusercontent.com/u/182834?v=4)](https://github.com/L1lle "L1lle (15 commits)")[![hnnweb](https://avatars.githubusercontent.com/u/3874960?v=4)](https://github.com/hnnweb "hnnweb (4 commits)")

---

Tags

laravelmathcaptchalaravel5math captcha

### Embed Badge

![Health badge](/badges/elic-dev-laravel-math-captcha/health.svg)

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

###  Alternatives

[schuppo/password-strength

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

1432.7M1](/packages/schuppo-password-strength)[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.2k](/packages/bllim-laravalid)[mdmsoft/yii2-captcha

Captcha with math equation

4211.1k](/packages/mdmsoft-yii2-captcha)[mohsen/captcha

A simple captcha for laravel 4

125.2k](/packages/mohsen-captcha)

PHPackages © 2026

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