PHPackages                             sayakb/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sayakb/akismet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sayakb/akismet
==============

Laravel 4.1 Akismet SPAM Processing Engine, Fork of kenmoini/akismet

2675PHP

Since Dec 17Pushed 12y ago1 watchersCompare

[ Source](https://github.com/sayakb/akismet)[ Packagist](https://packagist.org/packages/sayakb/akismet)[ RSS](/packages/sayakb-akismet/feed)WikiDiscussions master Synced 2d 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": {
	"sayakb/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:sayakb/akismet.git

```

Or alternatively, download from Packagist:

```
https://packagist.org/packages/sayakb/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:

```
'Sayakb\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.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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/d58478daae50e40aa0d5c24c95076af3da7ef58c00090044b0326cbb3e12f752?d=identicon)[sayakb](/maintainers/sayakb)

---

Top Contributors

[![kenmoini](https://avatars.githubusercontent.com/u/1857778?v=4)](https://github.com/kenmoini "kenmoini (10 commits)")[![sayakb](https://avatars.githubusercontent.com/u/2352440?v=4)](https://github.com/sayakb "sayakb (1 commits)")

### Embed Badge

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

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

###  Alternatives

[aryehraber/statamic-splash

Browse Unsplash images right from the CP.

125.8k](/packages/aryehraber-statamic-splash)

PHPackages © 2026

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