Skip to content

jbrathod/math-captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple math captcha for Laravel5

A captcha that will be used for multiple pages/places in single website.

Installation Guide

composer require jbrathod/math-captcha

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

    'providers' => [
        // ...
        'Jbrathod\MathCaptcha\MathCaptchaServiceProvider',
    ]

for Laravel 5.1+

    'providers' => [
        // ...
        Jbrathod\MathCaptcha\MathCaptchaServiceProvider::class,
    ]

Usage

Add captcha image to form (Note : "contact-us" is page name)

<img src="{{ app('mathcaptcha')->image('contact-us') }}"/>

Validate captcha

Add 'captcha' => 'required|mathcaptcha:contact-us' to rules array.

$this->validate($request, [
    'captcha' => 'required|mathcaptcha:contact-us',
]);

Reset captcha after form submit without errors

app('mathcaptcha')->reset('contact-us'); 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages