PHPackages                             devlop/speedtrap - 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/speedtrap

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

devlop/speedtrap
================

Simple speedtrap honeypot made for Laravel FormRequest

1.2.2(5y ago)013MITPHPPHP ^7.4|^8.0

Since Feb 17Pushed 5y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

 [![Latest Stable Version](https://camo.githubusercontent.com/7f063d63c950576786a9f5cfc9784a9f304114322185fe4f3ba7216c03a2d473/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766c6f702f737065656474726170)](https://packagist.org/packages/devlop/speedtrap) [![License](https://camo.githubusercontent.com/e9eb038cab87b9a7310be9a2d285b63273c176d973fb891a48feba5401d6150e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465766c6f702f737065656474726170)](https://github.com/devlop/speedtrap/blob/master/LICENSE.md)

Speedtrap
=========

[](#speedtrap)

Simple speedtrap honeypot made for Laravel FormRequest that detects spam bots by measuring the time it took to submit the form.

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

[](#installation)

```
composer require devlop/speedtrap

```

If you wish to change any of the speedtrap configuration options (such as the default threshold of 5 seconds or component name) you can publish the config, but this is usually not needed.

```
php artisan vendor:publish --provider="Devlop\Speedtrap\SpeedtrapServiceProvider"

```

Usage
=====

[](#usage)

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

```
namespace App\Http\Requests;

use Devlop\Speedtrap\WithSpeedtrap;
use Illuminate\Foundation\Http\FormRequest;

class DemoRequest extends FormRequest
{
    use WithSpeedtrap;
```

Next you need to add the speedtrap to your form.

```

    ... all your other form contents

```

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

```

        Slow down there muchacho!

    ... 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 speedtrap 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->withSpeedtrapRules([
            // 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->getSpeedtrapInputName() => $this->speedtrapRules(),
        ];
    }
```

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 speedtrap
        $speedtrap = $request->speedtrap();

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

5

Last Release

1897d ago

### 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 (7 commits)")

---

Tags

laravelspam-detectionvalidation

### Embed Badge

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

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

###  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)
