jbrathod / math-captcha
A captcha that uses multiple time in one website
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
This package is not auto-updated.
Last update: 2025-07-02 03:23:08 UTC
README
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');