cleantalk/laravel-antispam
Composer 安装命令:
composer require cleantalk/laravel-antispam
包简介
Anti-spam laravel extension by CleanTalk with protection against spam bots and manual spam.
关键字:
README 文档
README
CleanTalk is a powerful Laravel anti-spam solution for contact, registration, and comment forms. It offers invisible spam protection — no CAPTCHA, no reCAPTCHA, no user friction.
Unlike traditional CAPTCHA tools, CleanTalk silently filters spam in the background using behavioral analysis and real-time checks. It’s a drop-in replacement for CAPTCHA, built for Laravel developers who care about UX and clean code.
If you find this project useful, please consider starring ⭐ it on GitHub — it helps us grow and support development!
How does CleanTalk stop spam?
CleanTalk anti-spam service provides automatic and invisible protection for websites by analyzing visitor behavior and evaluating form submissions.
When a visitor submits a form on your site, CleanTalk sends the data to the cloud for analysis on CleanTalk cloud servers. These servers analyze the submitted data using several spam checks and content analysis methods, providing a quick decision on whether to allow the submission or mark it as spam. This process includes analyzing a wide range of parameters.
Based on these comprehensive checks, CleanTalk creates and continuously updates blacklists containing email addresses, IP addresses and website domains commonly used by spambots.
CleanTalk has developed advanced algorithms to accurately distinguish between real visitors and spambots, effectively blocking almost 100% of spam attempts.
Additional anti-spam features:
- Detailed spam logs: Monitor and analyze all incoming submissions and their spam status.
- Personal blacklists and whitelists: Manually allow or block specific IP addresses, email addresses, or domains.
- Country filtering: Block form submissions from selected countries.
- Stop word filtering: Automatically block messages containing specific words or phrases.
- Language filtering: Automatically block or allow comments and submissions based on their language, helping to reduce irrelevant or unwanted content.
- Disposable/temporary email blocking: Prevent registrations and form submissions from disposable email addresses commonly used by spammers.
- Real-time Email Verification: Automatically verify email addresses in real time, ensuring that submissions and signups are made from legitimate and existing email accounts.
Websites that trust CleanTalk!
Requirements
- CleanTalk account https://cleantalk.org/register?product=anti-spam
How to use
- Require the
cleantalk/laravel-antispammodule - Register the
CleantalkServiceProviderservice provider into your app.php - Register the
cleantalk_antispammiddleware into your Kernel.php - Load the publishes by
php artisan vendor:publishcommand - Edit
config/cleantalk.phpconfiguration file - Include JS into your root blade template (into head block)
@include('cleantalk::cleantalk') - Add the middleware to your routes which requires the anti-spam protection (usually form hanled route)
Details
- Open the terminal in the root of your laravel application and run command to require anti-spam module:
composer require cleantalk/laravel-antispam`
- Edit
config/app.phpfile, add new service provider to theprovidersarray:
\CleanTalkLaravel\CleantalkServiceProvider::class
For laravel 11 and 12 edit file bootstrap/providers.php, add to returned array
\CleanTalkLaravel\CleantalkServiceProvider::class
- Edit
app/Http/Kernel.phpfile, add new middleware to the$routeMiddlewarearray:
'cleantalk_antispam' => \CleanTalkLaravel\CleantalkValidate::class
For laravel 11 and 12 edit file bootstrap/app.php, add to ->withMiddleware method
$middleware->alias([ 'cleantalk_antispam' => \CleanTalkLaravel\CleantalkValidate::class ]);
- Open the terminal in the root of your laravel application and run command to generate config file and javascript asset:
php artisan vendor:publish
- Edit newly added configuration file
config/cleantalk.php, type your access key and changeenabledkey totrue - Include cleantalk blade template to your root blade template into block:
@include('cleantalk::cleantalk')
- So finally add the middleware to the required routes:
->middleware('cleantalk_antispam')
Now you can test the protection on the route contains cleantalk_antispam middleware, just use s@cleantalk.org test email for email field.
cleantalk/laravel-antispam 适用场景与选型建议
cleantalk/laravel-antispam 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.03k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2020 年 09 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「antispam」 「cleantalk」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cleantalk/laravel-antispam 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cleantalk/laravel-antispam 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cleantalk/laravel-antispam 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Honeypot extension for Nette Forms
Anti-spam yii2 extension by CleanTalk with protection against spam bots and manual spam
Increase your Flarum forum's security with hCaptcha.
Stand-alone antispambot function from WordPress
PHP client for tirreno security analytics API
Animated captcha generator
统计信息
- 总下载量: 2.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2020-09-28