pkboom/laravel-spam-filter

dev-master 2020-08-10 03:32 UTC

This package is auto-updated.

Last update: 2024-12-10 13:11:24 UTC


README

Latest Stable Version Build Status Total Downloads

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.