PHPackages                             devlop/honeypot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. devlop/honeypot

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

devlop/honeypot
===============

Simple honeypot made for Laravel FormRequest

2.2.1(5y ago)032MITPHPPHP ^7.4|^8.0

Since Feb 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/devlop/honeypot)[ Packagist](https://packagist.org/packages/devlop/honeypot)[ RSS](/packages/devlop-honeypot/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

 [![Latest Stable Version](https://camo.githubusercontent.com/1f3d08df084540b52d9f058724cf7bd25c7560ba077268a8240681248477e59e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766c6f702f686f6e6579706f74)](https://packagist.org/packages/devlop/honeypot) [![License](https://camo.githubusercontent.com/962a8562d65bcd12d1b1c16c9df42d953b9e6d161164961190eb2a857a6077fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465766c6f702f686f6e6579706f74)](https://github.com/devlop/honeypot/blob/master/LICENSE.md)

Honeypot
========

[](#honeypot)

Simple honeypot made for Laravel FormRequest that detects spam bots via a hidden honeypot field.

Installation
============

[](#installation)

```
composer require devlop/honeypot

```

If you wish to change any of the honeypot configuration options (such as the component name) you can publish the config, but this is usually not needed.

```
php artisan vendor:publish --provider="Devlop\Honeypot\HoneypotServiceProvider"

```

Usage
=====

[](#usage)

First, add the `WithHoneypot` trait to your FormRequest.

```
namespace App\Http\Requests;

use Devlop\Honeypot\WithHoneypot;
use Illuminate\Foundation\Http\FormRequest;

class DemoRequest extends FormRequest
{
    use WithHoneypot;
```

Next you need to add the honeypot to your form.

```

    ... all your other form contents

```

Optionally you can add a message to show when the honeypot was triggered, this only works when using automatic validation.

```

        Nice try! Go away!

    ... all your other form contents

```

Lastly, you need to configure the validation, it can either be automatic or manual.

Automatic validation
--------------------

[](#automatic-validation)

Add the honeypot rules to your rules configuration, this will make it redirect back to the form when triggered, as any other form validation error.

```
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules() : array
    {
        return $this->withHoneypotRules([
            // your normal rules goes here
        ]);
    }
```

Optionally you can also register the rules like this

```
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules() : array
    {
        return [
            // your normal rules goes here,
            $this->getHoneypotInputName() => $this->honeypotRules(),
        ];
    }
```

Manual validation
-----------------

[](#manual-validation)

If you are doing the validation manually you have more control of how you handle spammers, maybe you want to silently ignore it and give the spammer the impression of success? it's all up to you.

```
namespace App\Http\Controllers;

use App\Requests\DemoRequest;
use Illuminate\Http\Request;

class DemoController
{
    public function store(DemoRequest $request)
    {
        // get the honeypot
        $honeypot = $request->honeypot();

        if ($honeypot->triggered()) {
            // do something when the honeypot was triggered
        }
    }
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

7

Last Release

1899d ago

Major Versions

1.2.0 → 2.0.02021-02-16

PHP version history (2 changes)1.2.0PHP ^7.4

2.1.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10432296?v=4)[Johan Rosenson](/maintainers/johanrosenson)[@johanrosenson](https://github.com/johanrosenson)

---

Top Contributors

[![johanrosenson](https://avatars.githubusercontent.com/u/10432296?v=4)](https://github.com/johanrosenson "johanrosenson (18 commits)")

---

Tags

laravelspam-detectionvalidation

### Embed Badge

![Health badge](/badges/devlop-honeypot/health.svg)

```
[![Health](https://phpackages.com/badges/devlop-honeypot/health.svg)](https://phpackages.com/packages/devlop-honeypot)
```

###  Alternatives

[illuminate/validation

The Illuminate Validation package.

18936.7M1.4k](/packages/illuminate-validation)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[illuminate/queue

The Illuminate Queue package.

20331.4M1.2k](/packages/illuminate-queue)[illuminate/events

The Illuminate Events package.

13454.3M1.8k](/packages/illuminate-events)[illuminate/view

The Illuminate View package.

13144.9M1.7k](/packages/illuminate-view)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
