angus-dv/captcha
Composer 安装命令:
composer require 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.
README 文档
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.
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..
Installation
- Install ACaptcha via Composer:
composer require angus-dv/captcha
- Publish Assets:
After installation, you need to publish the necessary JavaScript, CSS, and image assets:
php artisan vendor:publish --tag=acaptcha
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>
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.
angus-dv/captcha 适用场景与选型建议
angus-dv/captcha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 141 次下载、GitHub Stars 达 5, 最近一次更新时间为 2024 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 angus-dv/captcha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 angus-dv/captcha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 141
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-06
