angus-dv/captcha

CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a security measure used to determine whether a user is a human or a bot. It helps prevent automated software from abusing online services, protecting websites from spam, fraud, and other malicious activities.

Maintainers

Package info

github.com/AngusDV/captcha

pkg:composer/angus-dv/captcha

Transparency log

Statistics

Installs: 214

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 0

1.2.0 2026-08-10 20:02 UTC

This package is auto-updated.

Last update: 2026-08-10 20:03:50 UTC


README

ACaptcha is a smart CAPTCHA solution designed to provide an easy and secure way to protect your web forms, similar to Google reCAPTCHA v2. Built with Laravel, ACaptcha is lightweight and user-friendly.

show

Features

  • Smart CAPTCHA: Advanced algorithms to distinguish between human users and bots.
  • Easy Integration: Simple to implement in your Laravel forms.
  • Customizable: Publish your own JavaScript, CSS, and images for masks and backgrounds.
  • Confusable Design: The masked images are crafted to be visually complex, making them difficult for OCR (Optical Character Recognition) systems to detect while remaining user-friendly for human interaction..
  • Refresh Control: Users can request a new challenge without reloading the form.
  • Mobile Friendly: Responsive sizing and Pointer Events support touch, pen, and mouse input.
  • Accessible Interaction: The puzzle piece also supports arrow keys and Enter/Space.

Installation

  1. Install ACaptcha via Composer:
composer require angus-dv/captcha
  1. Publish Assets:

After installation, you need to publish the necessary JavaScript, CSS, and image assets:

php artisan vendor:publish --tag=acaptcha

When upgrading ACaptcha, republish the assets so the browser receives the matching JavaScript, CSS, and translations:

php artisan vendor:publish --tag=acaptcha --force

Usage

1. Displaying the CAPTCHA

To include the CAPTCHA in your form, simply use the following HTML code:

<form  class="card"> 
 @include('ACaptcha::show')
</form>

The widget includes a refresh button automatically. On narrow screens, the challenge opens as a centered, touch-friendly panel and keeps verification coordinates accurate while scaling.

2. Verifying the CAPTCHA

You can verify the CAPTCHA on the backend using Laravel's validation rules. Use the ACaptchaVerify rule in your validation logic:

$request->validate([ 
	'a_captcha_hash_salt' => ['required', 'a_captcha_verify'],
 ]);
 
 or
 
$request->validate([ 
	'a_captcha_hash_salt' => ['required', new ACaptchaVerify],
 ]);

Alternatively, you can use the helper function to verify the CAPTCHA:

if (a_captcha_verify($request->input('a_captcha_hash_salt'))) { 
	// CAPTCHA verified successfully 
} else { 
	 // CAPTCHA verification failed 
}

Conclusion

ACaptcha is designed to be straightforward and powerful, making it a great addition to your Laravel application. Protect your forms and enhance security with minimal effort!

For further support or contributions, feel free to reach out or check the issues page.