PHPackages                             bxnxg/antispam-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. bxnxg/antispam-bundle

ActiveSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

bxnxg/antispam-bundle
=====================

This bundle provides some basic features to reduce spam in symfony forms.

08PHP

Since Sep 1Pushed 8mo agoCompare

[ Source](https://github.com/bxnxg/NucleosAntiSpamBundle)[ Packagist](https://packagist.org/packages/bxnxg/antispam-bundle)[ RSS](/packages/bxnxg-antispam-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

NucleosAntiSpamBundle
=====================

[](#nucleosantispambundle)

[![Latest Stable Version](https://camo.githubusercontent.com/e3042dd02e78e78c22f1969dfd3a506b1b3bc15f34dd0ca3cd5cdc4d90f95909/68747470733a2f2f706f7365722e707567782e6f72672f62786e78672f616e74697370616d2d62756e646c652f762f737461626c65)](https://packagist.org/packages/bxnxg/antispam-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/286f520f3733eca4da62e46ca3f69f9d99809b38221cc997926fa3ebfa095639/68747470733a2f2f706f7365722e707567782e6f72672f62786e78672f616e74697370616d2d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/bxnxg/antispam-bundle)[![License](https://camo.githubusercontent.com/5cf4d16402687b753725f73721c51388dab5b72e437b22dbdd5248fb2da99cfd/68747470733a2f2f706f7365722e707567782e6f72672f62786e78672f616e74697370616d2d62756e646c652f6c6963656e7365)](LICENSE.md)

[![Total Downloads](https://camo.githubusercontent.com/8ab47f5ac1c573d132666c7dc06bdd2a3450c02805ade39e85dbcc60b69e3590/68747470733a2f2f706f7365722e707567782e6f72672f62786e78672f616e74697370616d2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/bxnxg/antispam-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/20085c628db2ab51bf15ac88a6f00f0ab8e763ef1e497aa4a187f341b493dbb1/68747470733a2f2f706f7365722e707567782e6f72672f62786e78672f616e74697370616d2d62756e646c652f642f6d6f6e74686c79)](https://packagist.org/packages/bxnxg/antispam-bundle)[![Daily Downloads](https://camo.githubusercontent.com/9e93fbb1ee375d9499f3346049b47512fd5d3d79ce5c15e71dabc4f97a056188/68747470733a2f2f706f7365722e707567782e6f72672f62786e78672f616e74697370616d2d62756e646c652f642f6461696c79)](https://packagist.org/packages/bxnxg/antispam-bundle)

[![Continuous Integration](https://github.com/bxnxg/NucleosAntiSpamBundle/workflows/Continuous%20Integration/badge.svg)](https://github.com/bxnxg/NucleosAntiSpamBundle/actions)[![Code Coverage](https://camo.githubusercontent.com/ac1fd70be0c08c8dcf1ea5320b6f95d017b0b1c8657dfdf07f564b3888e15859/68747470733a2f2f636f6465636f762e696f2f67682f62786e78672f4e75636c656f73416e74695370616d42756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/bxnxg/NucleosAntiSpamBundle)

This bundle provides some basic features to reduce spam in symfony.

Installation
------------

[](#installation)

This package is forked from closed nucleos/NucleosAntiSpamBundle package. Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require bxnxg/antispam-bundle

```

### Enable the Bundle

[](#enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Bxnxg\AntiSpamBundle\NucleosAntiSpamBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

### Form based protection

[](#form-based-protection)

Create a form on the fly:

```
$this->createForm(CustomFormType:class, null, array(
    // Time protection
    'antispam_time'     => true,
    'antispam_time_min' => 10,
    'antispam_time_max' => 60,

    // Honeypot protection
    'antispam_honeypot'       => true,
    'antispam_honeypot_class' => 'hide-me',
    'antispam_honeypot_field' => 'email-repeat',
))
```

### Twig text protection

[](#twig-text-protection)

```
{# Replace plain text #}
{{ text|antispam }}

{# Replace rich text mails #}
{{ htmlText|antispam(true) }}
```

If you want a JavaScript decoding for the encoded mails, you should use the `AntiSpam.js` library:

```
document.addEventListener('DOMContentLoaded', () => {
  new AntiSpam('.custom_class');
});
```

It is recommended to use [webpack](https://webpack.js.org/) / [webpack-encore](https://github.com/symfony/webpack-encore)to include the JavaScript library in your page. These file is located in the `assets` folder.

### Global protection

[](#global-protection)

Add protection to all forms using the configuration:

```
# config/packages/nucleos_antispam.yaml

nucleos_antispam:
    # Time protection
    time:
        global: true

    # Honeypot protection
    honeypot:
        global: true
```

### Configure the Bundle

[](#configure-the-bundle)

Create a configuration file called `nucleos_antispam.yaml`:

```
# config/packages/nucleos_antispam.yaml

nucleos_antispam:
    # Twig mail filter
    twig:
        mail:
            css_class: 'custom_class'
            at_text:   [ '[DOT]', '(DOT)', '[.]' ]
            dot_text:  [ '[AT]', '(AT)', '[ÄT]' ]

    # Time protection
    time:
        min: 5
        max: 3600
        global: false

    # Honeypot protection
    honeypot:
        field: 'email_address'
        class: 'hidden'
        global: false
        provider: 'nucleos_antispam.provider.session'
```

### Assets

[](#assets)

It is recommended to use [webpack](https://webpack.js.org/) / [webpack-encore](https://github.com/symfony/webpack-encore)to include the `AntiSpam.js` file in your page. These file is located in the `assets` folder.

License
-------

[](#license)

This bundle is under the [MIT license](LICENSE.md).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/63ec117c94575a63889287ca0237b6f963e8c5f3159c5e71b8e5d3bfaa45e37d?d=identicon)[bxnxg](/maintainers/bxnxg)

### Embed Badge

![Health badge](/badges/bxnxg-antispam-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/bxnxg-antispam-bundle/health.svg)](https://phpackages.com/packages/bxnxg-antispam-bundle)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
