PHPackages                             codenexus/laravel-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. [Security](/categories/security)
4. /
5. codenexus/laravel-honeypot

AbandonedArchivedLibrary[Security](/categories/security)

codenexus/laravel-honeypot
==========================

Honeypot spam prevention.

1.0.1(7y ago)23.4k↓37.5%MITPHPPHP ^7.0

Since Aug 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/codenexus/laravel-honeypot)[ Packagist](https://packagist.org/packages/codenexus/laravel-honeypot)[ RSS](/packages/codenexus-laravel-honeypot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/05cb110ad831c829db55c9a5f47a8a2a1e2aa34e1611ffb560c8c29d564a2205/68747470733a2f2f706f7365722e707567782e6f72672f636f64656e657875732f6c61726176656c2d686f6e6579706f742f762f737461626c65)](https://packagist.org/packages/codenexus/laravel-honeypot) [![Total Downloads](https://camo.githubusercontent.com/2c2889f4bf0647ff620c37a25394121f87dcd3611ca9a5db77aff47ac46d4122/68747470733a2f2f706f7365722e707567782e6f72672f636f64656e657875732f6c61726176656c2d686f6e6579706f742f646f776e6c6f616473)](https://packagist.org/packages/codenexus/laravel-honeypot) [![License](https://camo.githubusercontent.com/85bbc96d7136ed8c54aa5e0f410d89084f59c5d406a48bd530e4b49db62dc644/68747470733a2f2f706f7365722e707567782e6f72672f636f64656e657875732f6c61726176656c2d686f6e6579706f742f6c6963656e7365)](https://packagist.org/packages/codenexus/laravel-honeypot) [![composer.lock](https://camo.githubusercontent.com/cf0addf58a439096933f4a60b0d11f140f587c7278e7c90dec1b9303d83bbddb/68747470733a2f2f706f7365722e707567782e6f72672f636f64656e657875732f6c61726176656c2d686f6e6579706f742f636f6d706f7365726c6f636b)](https://packagist.org/packages/codenexus/laravel-honeypot)

Honeypot spam prevention for Laravel applications
=================================================

[](#honeypot-spam-prevention-for-laravel-applications)

Compatibility
-------------

[](#compatibility)

Laravel 5.3 - 5.6

How does it work?
-----------------

[](#how-does-it-work)

"Honeypot" method of spam prevention is a simple and effective way to defer some of the spam bots that come to your site. This technique is based on creating an input field that should be left empty by the real users of the application but will most likely be filled out by spam bots.

This package creates two hidden input fields, honeypot field (like "my\_name") and a honeytime field - an encrypted timestamp that marks the moment when the page was served to the user. When the form containing these inputs invisible to the user is submitted to your application, a custom validator that comes with the package checks that the honeypot field is empty and also checks the time it took for the user to fill out the form. If the form was filled out too quickly (i.e. less than 5 seconds) or if there was a value put in the honeypot field, this submission is most likely from a spam bot.

Installation:
-------------

[](#installation)

In your terminal type : `composer require codenexus/laravel-honeypot` and provide "dev-master" as the version of the package. Or open up composer.json and add the following line under "require":

```
"require": {
    "codenexus/laravel-honeypot": "dev-master"
}
```

Next, add this line to 'providers' section of the app config file in `app/config/app.php`:

```
/*
 * Package Service Providers...
 */

...
Codenexus\Honeypot\HoneypotServiceProvider::class,
```

Add the honeypot facade to 'aliases':

```
...
'Honeypot' => Codenexus\Honeypot\Facades\Honeypot::class,
```

At this point the package is installed and you can use it as follows.

Usage :
-------

[](#usage-)

Add the honeypot catcher to your form by inserting `Honeypot::fill(..)` like this:

`{!! Honeypot::fill('my_name', 'my_time'); !!}`

The `fill` method will output the following HTML markup (`my_time` field will contain an encrypted timestamp):

```

```

After adding the honeypot fields in the markup with the specified macro add the validation for the honeypot and honeytime fields of the form:

```
$this->validate($request, [
    ...
    'my_name' => 'honeypot',
    'my_time' => 'required|honeytime:5'
]);
```

Please note that "honeytime" takes a parameter specifying number of seconds it should take for the user to fill out the form. If it takes less time than that the form is considered a spam submission.

That's it! Enjoy getting less spam in your inbox.

Credits
-------

[](#credits)

Based on work originally created by Ian Landsman:  as well as the remake by Maks Surguy:

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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 ~748 days

Total

2

Last Release

2794d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6.4

1.0.1PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9ff1c47f4f56fb1fb5c114c917d9455762e3d16cb713991260ac40c9a4ad22e?d=identicon)[codenex](/maintainers/codenex)

---

Top Contributors

[![cringerjs](https://avatars.githubusercontent.com/u/835448?v=4)](https://github.com/cringerjs "cringerjs (14 commits)")

---

Tags

laravelspamFormsHoneypot

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[msurguy/honeypot

Honeypot spam prevention

4381.2M12](/packages/msurguy-honeypot)[masterro/laravel-xss-filter

Filter user input for XSS but don't touch other html

41254.5k](/packages/masterro-laravel-xss-filter)[ircop/antiflood

Request flood protection for laravel

2024.2k1](/packages/ircop-antiflood)[laragear/poke

Keep your forms alive, avoid TokenMismatchException by gently poking your Laravel app

2211.5k](/packages/laragear-poke)

PHPackages © 2026

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