justijndepover / laravel-spam-keyword-validation
Laravel validation rule which checks for frequently used spam words
Installs: 57
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/justijndepover/laravel-spam-keyword-validation
Requires (Dev)
- orchestra/testbench: ^6.25|^7.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-09-27 23:16:00 UTC
README
This package adds a validation rule to Laravel to block requests based on frequently used SPAM words like bitcoin
, cryptocurrency
, etc...
For a full list, check out the config file
Installation
You can install the package with composer
composer require justijndepover/laravel-spam-keyword-validation
After installation you can optionally publish your configuration file
php artisan vendor:publish --tag="laravel-spam-keyword-validation-config"
configuration
This is the config file
<?php return [ /** * The list of keywords which cannot appear in the request value */ "keywords" => [ "http://", "https://", "www", "ftp://", "mailto:", "smb://", "afp://", "file://", "gopher://", "news://", "ssl://", "sslv2://", "sslv3://", "tls://", "tcp://", "udp://", "url=", "href=", "dating", "sex", "porn", "fuck", "free", "win", "buy", "captcha", "spam", "hello. and bye.", "mail.ru", "reading this message", "reading my message", "reading through my message", "are whitelisted", "great website", "late client", "ciao a tutti", "viagra", "cheap", "casino", "advertising", "keyword", "promotion", "porntubered", "ps: how are you?", "beautiful models", "privet", "beautiful girls", "best girls", "dosug", "trustable", "look at the", "v7bomdefex", "what is it -", "email marketing", "read your site", "crypto", "cryptography", "cryptocurrency", "bitcoin", "ethereum", "dogecoin", ], ];
Usage
Your request can be validated with the blockSpamKeywords validation rule:
$request->validate([ 'message' => ['blockSpamKeywords'], ]);
Security
If you find any security related issues, please open an issue or contact me directly at justijndepover@gmail.com.
Contribution
If you wish to make any changes or improvements to the package, feel free to make a pull request.
License
The MIT License (MIT). Please see License File for more information.