This package is a Laravel package that checks if an email address is a spammer. It verifies your signups and form submissions to confirm that they are legitimate.
You can install the package via composer:
composer require martian/spammailchecker- If you are using Laravel 5.5 or higher, you can use the package directly:
composer require 'martian/spammailchecker'. - If you're using Laravel 5.4 or lower, you'll need to register the service provider. Open
config/app.phpand add the following line to theprovidersarray:
Martian\SpamMailChecker\SpamMailCheckerServiceProvider::class,Make use of spammail in your validation rules:
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'email' => 'required|email|spammail|max:255',
]);
}Or make use of spammail in your Requests file like this:
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => 'required|email|spammail|max:255',
];
}Error message shown when the email is a spam:
By default, the error message is:
"email": [
"The email address is a spam address, please try another one."
]
You can customize the error message by opening resources/lang/en/validation.php and adding to the array like so:
'spammail' => 'You are using a spam email address nerd :-P',composer testPlease see CHANGELOG for more information what has changed recently.
Please feel free to fork this project and make a pull request. For more information check CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Here are some ways you can give back to the project:
- Star on GitHub
- Follow me on Twitter @hendurhance
The MIT License (MIT). Please see License File for more information.

