StopForumSpam for Laravel 6.x/7.x/8.x

Overview

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('[email protected]')->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

You might also like...
Laravel Larex lets you translate your whole Laravel application from a single CSV file.
Laravel Larex lets you translate your whole Laravel application from a single CSV file.

Laravel Larex Translate Laravel Apps from a CSV File Laravel Larex lets you translate your whole Laravel application from a single CSV file. You can i

A Laravel package that adds a simple image functionality to any Laravel model
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

A Laravel extension for using a laravel application on a multi domain setting
A Laravel extension for using a laravel application on a multi domain setting

Laravel Multi Domain An extension for using Laravel in a multi domain setting Description This package allows a single Laravel installation to work wi

Example of using abrouter/abrouter-laravel-bridge in Laravel
Example of using abrouter/abrouter-laravel-bridge in Laravel

ABRouter Laravel Example It's a example of using (ABRouter Laravel Client)[https://github.com/abrouter/abrouter-laravel-bridge] Set up locally First o

Laravel router extension to easily use Laravel's paginator without the query string

🚨 THIS PACKAGE HAS BEEN ABANDONED 🚨 We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore.

Laravel application project as Sheina Online Store backend to be built with Laravel and VueJS

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Postgis extensions for laravel. Aims to make it easy to work with geometries from laravel models.

Laravel Wrapper for PostgreSQL's Geo-Extension Postgis Features Work with geometry classes instead of arrays. $model-myPoint = new Point(1,2); //lat

laravel - Potion is a pure PHP asset manager for Laravel 5 based off of Assetic.

laravel-potion Potion is a pure PHP asset manager for Laravel based off of Assetic. Description Laravel 5 comes with a great asset manager called Elix

Llum illuminates your Laravel projects speeding up your Github/Laravel development workflow
Llum illuminates your Laravel projects speeding up your Github/Laravel development workflow

Llum illuminates your Laravel projects speeding up your Github/Laravel development workflow

Comments
  • Always returning false?

    Always returning false?

    Hi,

    I am using Laravel 6.9 and nickurt/laravel-stopforumspam 1.5. The following methods:

    \StopForumSpam::setEmail(...)->isSpamEmail();
    \StopForumSpam::setIp(...)->isSpamIp()
    

    always return false.

    For example, [email protected] (taken from https://www.stopforumspam.com/domain/07stees.online) will be marked as "spam" if we use the API directly, by visiting http://api.stopforumspam.org/[email protected] and downloading the XML response:

    <response success="true">
    	<type>email</type>
    	<appears>yes</appears>
    	<lastseen>2020-03-09 20:39:27</lastseen>
    	<frequency>1</frequency>
    </response>
    

    However, this:

    \StopForumSpam::setEmail('[email protected]')->isSpamEmail()
    

    ... will return false.

    opened by FilipQL 3
  • Upgrade to GitHub-native Dependabot

    Upgrade to GitHub-native Dependabot

    Dependabot Preview will be shut down on August 3rd, 2021. In order to keep getting Dependabot updates, please merge this PR and migrate to GitHub-native Dependabot before then.

    Dependabot has been fully integrated into GitHub, so you no longer have to install and manage a separate app. This pull request migrates your configuration from Dependabot.com to a config file, using the new syntax. When merged, we'll swap out dependabot-preview (me) for a new dependabot app, and you'll be all set!

    With this change, you'll now use the Dependabot page in GitHub, rather than the Dependabot dashboard, to monitor your version updates, and you'll configure Dependabot through the new config file rather than a UI.

    If you've got any questions or feedback for us, please let us know by creating an issue in the dependabot/dependabot-core repository.

    Learn more about migrating to GitHub-native Dependabot

    Please note that regular @dependabot commands do not work on this pull request.

    dependencies 
    opened by dependabot-preview[bot] 0
  •  Call to a member function getBody() on null

    Call to a member function getBody() on null

    [2022-11-01 22:40:16] local.ERROR: Call to a member function getBody() on null {"exception":"[object] (Error(code: 0): Call to a member function getBody() on null at C:\wamp64\www\test\vendor
    ickurt\laravel-stopforumspam\src\StopForumSpam.php:45) [stacktrace] #0 C:\wamp64\www\test\vendor\laravel\framework\src\Illuminate\Cache\Repository.php(391): nickurt\StopForumSpam\StopForumSpam->nickurt\StopForumSpam\{closure}() #1 C:\wamp64\www\test\vendor\laravel\framework\src\Illuminate\Cache\CacheManager.php(418): Illuminate\Cache\Repository->remember('laravel-stopfor...', 10, Object(Closure)) #2 C:\wamp64\www\test\vendor
    ickurt\laravel-stopforumspam\src\StopForumSpam.php(46): Illuminate\Cache\CacheManager->__call('remember', Array) #3 C:\wamp64\www\test\vendor
    ickurt\laravel-stopforumspam\src\Rules\IsSpamEmail.php(41): nickurt\StopForumSpam\StopForumSpam->isSpamEmail()

    opened by damku999 0
Owner
Nick
Nick
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.

What is laravel charts? Charts is a Laravel library used to create Charts using Chartisan. Chartisan does already have a PHP adapter. However, this li

Erik C. Forés 31 Dec 18, 2022
Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster.

Laravel Kickstart What is Laravel Kickstart? Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster. It com

Sam Rapaport 46 Oct 1, 2022
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application.

Laravel Segment Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application. Installation You can install the pac

Octohook 13 May 16, 2022
Laravel Sanctum support for Laravel Lighthouse

Lighthouse Sanctum Add Laravel Sanctum support to Lighthouse Requirements Installation Usage Login Logout Register Email Verification Forgot Password

Daniël de Wit 43 Dec 21, 2022
Bring Laravel 8's cursor pagination to Laravel 6, 7

Laravel Cursor Paginate for laravel 6,7 Installation You can install the package via composer: composer require vanthao03596/laravel-cursor-paginate U

Pham Thao 9 Nov 10, 2022
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Adnane Kadri 49 Jun 22, 2022
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

null 686 Dec 28, 2022
Laravel Jetstream is a beautifully designed application scaffolding for Laravel.

Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your next Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.

The Laravel Framework 3.5k Jan 8, 2023