Filter spams
Using a honeypot, you can easily filter spams. This package uses spatie/laravel-honeypot under the hood.
Installation
You can install the package via composer:
composer require pkboom/laravel-spam-filter
Usage
Place this in your form.
<form>
<input name="honeypot" type="hidden" value="" />
<input
name="encrypted_time"
type="hidden"
value="{{ \Spatie\Honeypot\EncryptedTime::create(now()->addSecond()) }}"
/>
...
</form>
Filter spams
use Illuminate\Support\Facades\Request;
if (Request::isSpam()) {
return response('', 400);
}
Testing
composer test
License
The MIT License (MIT). Please see MIT license for more information.