Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Stopforumspam Laravel Package

vigstudio/laravel-stopforumspam

Laravel package that integrates StopForumSpam checks into your app to detect and block spammy registrations or requests by IP, email, or username. Includes easy configuration and middleware/validation-friendly helpers for quick spam protection.

View on GitHub
Deep Wiki
Context7

Laravel StopForumSpam

Build Status Total Downloads Latest Stable Version MIT Licensed

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

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

// 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

// 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

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

Manually Usage - IsSpamIp

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

Manually Usage - IsSpamUsername

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

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

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

IsSpamIp Event

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

IsSpamUsername Event

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

Tests

composer test

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity