PHPackages                             kenmoini/akismet - 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. kenmoini/akismet

ActiveLibrary

kenmoini/akismet
================

Laravel 4 Akismet SPAM Processing Engine

33718[3 issues](https://github.com/kenmoini/akismet/issues)PHP

Since Feb 24Pushed 11y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Introduction
============

[](#introduction)

This is a simple little PHP5 class that enables you use the Akismet anti-spam service in your Laravel 4 application. Most of the ground work was done by Alex Potsides,

Download
========

[](#download)

If you're using Laravel 4, you can skip the download proceedure and simply add the following line to your app's composer.json file in the require block

```
"require": {
	"kenmoini/akismet": "dev-master",
},

```

and then run from your Laravel 4 application directory: php composer.phar install

Or check out the git repository:

```
git clone git@github.com:kenmoini/akismet.git

```

Or alternatively, download from Packagist:

```
https://packagist.org/packages/kenmoini/akismet

```

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

[](#installation)

Once you have the package loaded into your application's file system, open the app/config/app.php file and add the following line to the 'providers' array:

```
'Kenmoini\Akismet\AkismetServiceProvider',

```

Then, in that same file, add a new key such as the following:

```
/*
 * Akismet API Key
 */
'akismet_api_key' => 'YOUR_KEY_HERE',

```

Don't have a key yet? Goto the [Akismet site](https://akismet.com) and sign up for one. It's free and takes a few moments of your time

Usage
=====

[](#usage)

Before you can use Akismet, you need an Akismet API key (they are free and getting one takes about five minutes). Once you have one, let's test it with a new route. In your routes.php file add the following:

```
Route::get('testAkismet', function() {
	$apiKey = Config::get('app.akismet_api_key');
	$siteURL = Config::get('app.url');
	$akismet = new Akismet($siteURL, $apiKey);
	if ($akismet->isKeyValid()) { echo 'valid!'; } else { echo 'error!'; }
});

```

And from there, load your browser to **example.com/testAkismet** (replacing *example.com* with your domain of course). If you see **"valid!"** then everything's installed and configured correctly and from there you can go about following the next bit of info to spam check submitted data

In an example application, one might have a simple Contact form with the inputs of *Name*, *Email Address*, *Author URL*, and *Comment Body*. These inputs reassign to *$name*, *$email*, *$url*, and *$comment*, respectfully (after POST processing/sanitation/variable assigning/etc). So let's submit that data to check for spammy-ness with Akismet:

```
$apiKey = Config::get('app.akismet_api_key');
$siteURL = Config::get('app.url');
$akismet = new Akismet($siteURL ,$apiKey);
$akismet->setCommentAuthor($name);
$akismet->setCommentAuthorEmail($email);
$akismet->setCommentAuthorURL($url);
$akismet->setCommentContent($comment);
$akismet->setPermalink('http://www.example.com/contact-form/');

if($akismet->isCommentSpam())
  // store the comment but mark it as spam (in case of a mis-diagnosis)
else
  // store the comment normally

```

That's just about it. In the event that the filter wrongly tags messages, you can at a later date create a new object and populate it from your database, overriding fields where necessary and then use the following two methods to train it:

```
$akismet->submitSpam();

```

and

```
$akismet->submitHam();

```

to submit mis-diagnosed spam and ham, which improves the system for everybody.

Changelog
---------

[](#changelog)

### Version 0.6

[](#version-06)

- Cleaned up README.md. I know, a big change. Tests coming next update.

### Version 0.5

[](#version-05)

- Internal testing version found operational. Deployed to GitHub

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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.

### Community

Maintainers

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

---

Top Contributors

[![kenmoini](https://avatars.githubusercontent.com/u/1857778?v=4)](https://github.com/kenmoini "kenmoini (14 commits)")[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (1 commits)")

### Embed Badge

![Health badge](/badges/kenmoini-akismet/health.svg)

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

PHPackages © 2026

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