cleantalk/laravel-antispam

Anti-spam laravel extension by CleanTalk with protection against spam bots and manual spam.

Installs: 859

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 6

Forks: 5

Open Issues: 0

Type:laravel-extension

3.0.0 2025-07-07 01:57 UTC

This package is auto-updated.

Last update: 2025-07-11 11:31:14 UTC


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.

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.

Requirements

How to use

  1. Require the cleantalk/laravel-antispam module
  2. Register the CleantalkServiceProvider service provider into your app.php
  3. Register the cleantalk_antispam middleware into your Kernel.php
  4. Load the publishes by php artisan vendor:publish command
  5. Edit config/cleantalk.php configuration file
  6. Include JS into your root blade template (into head block) @include('cleantalk::cleantalk')
  7. Add the middleware to your routes which requires the anti-spam protection (usually form hanled route)

Details

  1. Open the terminal in the root of your laravel application and run command to require anti-spam module:
composer require cleantalk/laravel-antispam`
  1. Edit config/app.php file, add new service provider to the providers array:
\CleanTalkLaravel\CleantalkServiceProvider::class

For laravel 11 and 12 edit file bootstrap/providers.php, add to returned array

\CleanTalkLaravel\CleantalkServiceProvider::class
  1. Edit app/Http/Kernel.php file, add new middleware to the $routeMiddleware array:
'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
]);
  1. Open the terminal in the root of your laravel application and run command to generate config file and javascript asset:
php artisan vendor:publish
  1. Edit newly added configuration file config/cleantalk.php, type your access key and change enabled key to true
  2. Include cleantalk blade template to your root blade template into block:
@include('cleantalk::cleantalk')
  1. 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.