PHPackages                             nickurt/laravel-stopforumspam - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nickurt/laravel-stopforumspam

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nickurt/laravel-stopforumspam
=============================

StopForumSpam for Laravel 11.x/12.x/13.x

2.2(2mo ago)6965.0k↑70.5%6MITPHPPHP ^8.2CI passing

Since Feb 15Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/nickurt/laravel-stopforumspam)[ Packagist](https://packagist.org/packages/nickurt/laravel-stopforumspam)[ RSS](/packages/nickurt-laravel-stopforumspam/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (12)Versions (15)Used By (0)

Laravel StopForumSpam
---------------------

[](#laravel-stopforumspam)

[![Build Status](https://github.com/nickurt/laravel-stopforumspam/workflows/tests/badge.svg)](https://github.com/nickurt/laravel-stopforumspam/actions)[![Total Downloads](https://camo.githubusercontent.com/500eef6b020254b869257c5281c2b1af96938f343e004e23aa0e7222a763611c/68747470733a2f2f706f7365722e707567782e6f72672f6e69636b7572742f6c61726176656c2d73746f70666f72756d7370616d2f642f746f74616c2e737667)](https://packagist.org/packages/nickurt/laravel-plesk)[![Latest Stable Version](https://camo.githubusercontent.com/188c9e196e6a1eef5d9503b829d6af9917e8a1d03929afaeb546fbd567db8da3/68747470733a2f2f706f7365722e707567782e6f72672f6e69636b7572742f6c61726176656c2d73746f70666f72756d7370616d2f762f737461626c652e737667)](https://packagist.org/packages/nickurt/laravel-plesk)[![MIT Licensed](https://camo.githubusercontent.com/049e1894f04fac8475b488341bb75ac644c011674bfaefcd9ac8620c4083c528/68747470733a2f2f706f7365722e707567782e6f72672f6e69636b7572742f6c61726176656c2d73746f70666f72756d7370616d2f6c6963656e73652e737667)](LICENSE.md)

### Installation

[](#installation)

Install this package with composer:

```
composer require nickurt/laravel-stopforumspam

```

Copy the config files for the StopForumSpam-plugin

```
php artisan vendor:publish --provider="nickurt\StopForumSpam\ServiceProvider" --tag="config"

```

### Examples

[](#examples)

#### Validation Rule - IsSpamEmail

[](#validation-rule---isspamemail)

```
// FormRequest ...

public function rules()
{
    return [
        'email' => ['required', new \nickurt\StopForumSpam\Rules\IsSpamEmail(20)]
    ];
}

// Manually ...

$validator = validator()->make(request()->all(), ['email' => ['required', new \nickurt\StopForumSpam\Rules\IsSpamEmail(20)]]);
```

The `IsSpamEmail`-rule has one optional paramter `frequency` (default 10) to validate the request.

#### Validation Rule - IsSpamIp

[](#validation-rule---isspamip)

```
// FormRequest ...

public function rules()
{
    return [
        'ip' => ['required', new \nickurt\StopForumSpam\Rules\IsSpamIp(20)]
    ];
}

// Manually ...

$validator = validator()->make(request()->all(), ['ip' => ['required', new \nickurt\StopForumSpam\Rules\IsSpamIp(20)]]);
```

The `IsSpamIp`-rule has one optional paramter `frequency` (default 10) to validate the request.

#### Validation Rule - IsSpamUsername

[](#validation-rule---isspamusername)

```
// FormRequest ...

public function rules()
{
    return [
        'username' => ['required', new \nickurt\StopForumSpam\Rules\IsSpamUsername(20)]
    ];
}

// Manually ...

$validator = validator()->make(request()->all(), ['username' => ['required', new \nickurt\StopForumSpam\Rules\IsSpamUsername(20)]]);
```

The `IsSpamUsername`-rule has one optional paramter `frequency` (default 10) to validate the request.

#### Manually Usage - IsSpamEmail

[](#manually-usage---isspamemail)

```
\StopForumSpam::setEmail('nickurt@users.noreply.github.com')->isSpamEmail();
```

#### Manually Usage - IsSpamIp

[](#manually-usage---isspamip)

```
\StopForumSpam::setIp('8.8.8.8')->isSpamIp();
```

#### Manually Usage - IsSpamUsername

[](#manually-usage---isspamusername)

```
\StopForumSpam::setUsername('nickurt')->isSpamUsername();
```

#### Adding to the Database

[](#adding-to-the-database)

You can report a spammer to the StopForumSpam database using `reportSpam()`. This requires an API key (set `STOPFORUMSPAM_APIKEY` in your `.env`) and all three of: `ip`, `email`, and `username`. Evidence is optional and should be the post content. Do not include your email or site URL in Evidence.

See Adding to the Database for more information:

```
\StopForumSpam::setIp('8.8.8.8')
    ->setEmail('spam@example.com')
    ->setUsername('spammer')
    ->reportSpam();

// Optionally include evidence
\StopForumSpam::setIp('8.8.8.8')
    ->setEmail('spam@example.com')
    ->setUsername('spammer')
    ->setEvidence('Posted 50 identical spam messages.')
    ->reportSpam();
```

Returns `true` on success. Throws a `MalformedIPException` if the IP is invalid, a `MalformedEmailException` if the email is invalid, or an `Exception` if the API key or any required field is missing.

#### Events

[](#events)

You can listen to the `IsSpamEmail`, `IsSpamIp` and `IsSpamUsername` events, e.g. if you want to log all the `IsSpam`-requests in your application

##### IsSpamEmail Event

[](#isspamemail-event)

This event will be fired when the request-email is above the frequency of sending spam `nickurt\StopForumSpam\Events\IsSpamEmail`

##### IsSpamIp Event

[](#isspamip-event)

This event will be fired when the request-ip is above the frequency of sending spam `nickurt\StopForumSpam\Events\IsSpamIp`

##### IsSpamUsername Event

[](#isspamusername-event)

This event will be fired when the request-username is above the frequency of sending spam `nickurt\StopForumSpam\Events\IsSpamUsername`

### Tests

[](#tests)

```
composer test
```

---

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance83

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~228 days

Recently: every ~284 days

Total

14

Last Release

88d ago

Major Versions

1.9 → 2.02025-02-25

PHP version history (7 changes)1.0PHP ^7.0

1.1PHP ^7.1.3

1.2PHP ^7.2

1.7PHP ^8.0|^7.4

1.7.1PHP ^8.0

1.8PHP ^8.1

1.9PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5840084?v=4)[Nick](/maintainers/nickurt)[@nickurt](https://github.com/nickurt)

---

Top Contributors

[![nickurt](https://avatars.githubusercontent.com/u/5840084?v=4)](https://github.com/nickurt "nickurt (39 commits)")[![BrookeDot](https://avatars.githubusercontent.com/u/150348?v=4)](https://github.com/BrookeDot "BrookeDot (5 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

laravellaravel-stopforumspamspamstopforumspamlaravelstopforumspam

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nickurt-laravel-stopforumspam/health.svg)

```
[![Health](https://phpackages.com/badges/nickurt-laravel-stopforumspam/health.svg)](https://phpackages.com/packages/nickurt-laravel-stopforumspam)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

206971.5k11](/packages/backpack-basset)

PHPackages © 2026

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