PHPackages                             fungku/spamguard - 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. fungku/spamguard

ActiveLibrary[Security](/categories/security)

fungku/spamguard
================

Guarding form requests from spam bots.

v0.2.0(10y ago)131282Apache-2.0PHPPHP &gt;=5.5.9

Since Jul 5Pushed 9y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (11)Used By (0)

SpamGuard
=========

[](#spamguard)

Guarding form requests against bots.

[![Version](https://camo.githubusercontent.com/7ec05bc911968f493acf0b8b87d9b2329245589e753517ea29aaaeac4001569b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66756e676b752f7370616d67756172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fungku/spamguard)[![License](https://camo.githubusercontent.com/3e36ec150f4a3a999e8ed806947b60a0e4cb4f974f602bf6dbe49bfc65ffaadc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66756e676b752f7370616d67756172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fungku/spamguard)[![Downloads](https://camo.githubusercontent.com/4a3e1e85d39105a837b3595626851270694ef75c491cce5c15525867ee47a4b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66756e676b752f7370616d67756172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fungku/spamguard)[![Quality](https://camo.githubusercontent.com/6fc5f16dd98edecbb1420356c045313ee4e4429bb6db6adc0b2e228c6f097ce5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f66756e676b752f6c61726176656c2d7370616d67756172642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fungku/laravel-spamguard/)[![Travis](https://camo.githubusercontent.com/585ad75155f5578b6e97272f4529ea2e36ebf7764e84361d24fb4fabd5685ca3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7279616e77696e636865737465722f6c61726176656c2d7370616d67756172642e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/fungku/laravel-spamguard)

Install
-------

[](#install)

```
composer require fungku/spamguard
```

Add the service provider to `config/app.php` in the `providers` array:

```
Fungku\SpamGuard\Providers\SpamGuardServiceProvider::class,
```

Add the alias to `config/app.php` in the `aliases` array:

```
'SpamGuard' => Fungku\SpamGuard\Facades\SpamGuard::class,
```

Config (optional)
-----------------

[](#config-optional)

If you'd like to change the default package config values, then publish the config and change the defaults...

```
php artisan vendor:publish --provider="Fungku\SpamGuard\Providers\SpamGuardConfigServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

To use the spamguard, there are two things you need to do.

### 1. Add the *SpamGuard* form elements in your form

[](#1-add-the-spamguard-form-elements-in-your-form)

Somewhere inside your form, just use `SpamGuard::html()`.

Using all spam guard elements:

```

    {!! SpamGuard::html() !!}

```

Specifying specific elements:

```

    {!! SpamGuard::html(['spam_honeypot', 'spam_timer', 'spam_recaptcha']) !!}

```

### 2. Add the *SpamGuard* middleware to your route or controller

[](#2-add-the-spamguard-middleware-to-your-route-or-controller)

Specifying specific middlewares:

```
class MyController extends Controller
{
    public function __construct()
    {
        $this->middleware('spam_honeypot');
        $this->middleware('spam_timer');
        $this->middleware('spam_recaptcha');
    }
}
```

Using all spam middleware:

```
$this->middleware('spamguard');
```

Using the `spam_timer` middleware in a controller normally and overriding the `min_time` and `max_time` for a specific action:

```
$this->middleware('spam_timer:10,300', ['only' => 'postComment']);
```

Options
-------

[](#options)

Currently there are four spam middleware registered:

- `spam_honeypot`
- `spam_timer`
- `spam_recaptcha`
- `spamguard`: A catch-all of all the available SpamGuard middleware listed above.

Notes
-----

[](#notes)

If you are selectively using elements and middleware, please note that the elements you use must match up with the middleware you assign to the routes.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Recently: every ~3 days

Total

10

Last Release

3766d ago

### Community

Maintainers

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

---

Top Contributors

[![ryanwinchester](https://avatars.githubusercontent.com/u/2897340?v=4)](https://github.com/ryanwinchester "ryanwinchester (41 commits)")

---

Tags

middlewarelaravelspambot

### Embed Badge

![Health badge](/badges/fungku-spamguard/health.svg)

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

###  Alternatives

[msurguy/honeypot

Honeypot spam prevention

4381.2M12](/packages/msurguy-honeypot)[gregwar/captcha-bundle

Captcha bundle

3524.7M32](/packages/gregwar-captcha-bundle)[masterro/laravel-xss-filter

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

41254.5k](/packages/masterro-laravel-xss-filter)[stevenmaguire/laravel-middleware-csp

Provides support for enforcing Content Security Policy with headers in Laravel responses.

39107.6k](/packages/stevenmaguire-laravel-middleware-csp)[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)
