PHPackages                             lucbu/laravelcaptcha - 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. [Image &amp; Media](/categories/media)
4. /
5. lucbu/laravelcaptcha

ActivePlugin[Image &amp; Media](/categories/media)

lucbu/laravelcaptcha
====================

Create captcha easily with laravel.

v1.0.0(10y ago)0272MITPHPPHP &gt;=5.3.0

Since Jul 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lucbu/laravelcaptcha)[ Packagist](https://packagist.org/packages/lucbu/laravelcaptcha)[ RSS](/packages/lucbu-laravelcaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

LaravelCaptcha
==============

[](#laravelcaptcha)

Working on **Laravel 5**. French, English and Spanish!!!

[![Captcha Example](https://camo.githubusercontent.com/a9343339dea63fbee21eda78bb615d385802aac3af9a994f7a399f052a942a5f/687474703a2f2f7777772e696d61676575706c6f61642e636f2e756b2f696d616765732f323031352f30372f32372f636170746368612e706e67)](https://camo.githubusercontent.com/a9343339dea63fbee21eda78bb615d385802aac3af9a994f7a399f052a942a5f/687474703a2f2f7777772e696d61676575706c6f61642e636f2e756b2f696d616765732f323031352f30372f32372f636170746368612e706e67)

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

[](#installation)

Install with composer :

```
composer require lucbu\laravelcaptcha dev-master

```

Just add in the array `providers` in the file `config\app.php`:

```
'Lucbu\LaravelCaptcha\CaptchaServiceProvider',
```

Publish the package using the command :

```
php artisan vendor:publish --provider="Lucbu\LaravelCaptcha\CaptchaServiceProvider"

```

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

[](#configuration)

In the file `config\lucbu-laravelcaptcha.php` there is some parameters that you can modify:

- length: The length of the captcha (should be an integer)
- listForbidden: list of letters that won't appear in captcha
- icon-play: Path to icon image used to display the clicking button to hear the sounds of letters
- icon-update: Path to icon image used to update the captcha
- background-color: color of the captcha background (use red green blue notation \['red' =&gt; $red, 'green' =&gt; $green, 'blue' =&gt; $blue\])
- text-color: color of the captcha text (use red green blue notation)
- grid: Is there a grid behind the letters?
- space-grid: Space between the line of the grid
- line: Is there random lines on the captcha?
- filter-smooth: Apply smooth filter to captcha
- filter-smooth-level: Level of filter
- width: width of the captcha image;
- height: height of the captcha image
- width-html: width of the image displayed in the view in px
- height-html: height of the image displayed in the view in px
- sessionKey: the key used to store the captcha in Session Variable
- default\_language: the language in case we don't find the sounds for the locale

Usage
-----

[](#usage)

In the form view, just use the following code :

```
@include('lucbu-laravelcaptcha::captcha')
```

You can validate the fields that has to be fulfill with captcha with the rule `lucbularavelcaptcha` :

```
public function rules() {
    return [
        'captcha' => 'required|lucbularavelcaptcha:is_caseSensitive'
    ];
}
```

You can set the parameters is\_caseSensitive as 'true' or 'false', the validation will take care or not of matching the case (false by default).

You can generate a captcha in a controller like this :

```
