PHPackages                             dosomething/stathat - 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. [API Development](/categories/api)
4. /
5. dosomething/stathat

ActiveLibrary[API Development](/categories/api)

dosomething/stathat
===================

Simple API wrapper for StatHat.

v2.0.1(10y ago)35.3k1[4 issues](https://github.com/DoSomething/stathat-php/issues)1MITPHPPHP &gt;=5.4.0

Since May 1Pushed 10y ago12 watchersCompare

[ Source](https://github.com/DoSomething/stathat-php)[ Packagist](https://packagist.org/packages/dosomething/stathat)[ RSS](/packages/dosomething-stathat/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (7)Used By (1)

StatHat [![StyleCI](https://camo.githubusercontent.com/89dfe3f48d5dd3464e396d3730fc0beb8d082eeb2a1b0cb4228e9d6cdc4144b5/68747470733a2f2f7374796c6563692e696f2f7265706f732f33343930383232322f736869656c64)](https://styleci.io/repos/34908222) [![Packagist](https://camo.githubusercontent.com/a98d9f4908cd185d02a333507608f06ffe71436b1af3a6cff17381338ae58ece/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f736f6d657468696e672f737461746861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dosomething/stathat)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#stathat--)

This is a simple, modern API wrapper for [StatHat](https://www.stathat.com). It also includes optional support for usage as a service in Laravel 5.

### Installation

[](#installation)

Install with Composer:

```
"require": {
    "dosomething/stathat": "^2.0.0"
}
```

### Usage

[](#usage)

In vanilla PHP, require the `Client` class and create a new instance with your credentials.

```
  use DoSomething\StatHat\Client as StatHat;

  $stathat = new StatHat([
    'user_key' => '',       // required for count() and value()
    'ez_key' => 'your_ez_key@example.com', // required for ezCount() and ezValue()
    'access_token' => 'ABC123abc',         // required for AlertsAPI
    'prefix' => 'appname - ',              // optional! will be prepended to EZ stat names
    'debug' => false,                      // optional! will prevent sending stats if true.
  ]);

  // And go!
  $stathat->ezCount('', 1);
  $stathat->ezValue('', 15);

  $stathat->count('', 1);
  $stathat->value('', 9);
```

### Laravel Usage

[](#laravel-usage)

Laravel support is built-in. Simply add a service provider &amp; facade alias to your `config/app.php`:

```
  'providers' => [
    // ...
    DoSomething\StatHat\StatHatServiceProvider::class,
  ],

  'aliases' => [
    // ...
    'StatHat' => DoSomething\StatHat\Facades\StatHat::class
  ],
```

Finally, add your keys to the `config/services.php` configuration array:

```
  'stathat' => [
    'user_key' => '',       // required for count() and value()
    'ez_key' => 'your_ez_key@example.com', // required for ezCount() and ezValue()
    'prefix' => 'appname - ',              // optional! will be prepended to EZ stat names
    'debug' => env('APP_DEBUG'),           // optional! will prevent sending stats in debug mode.
  ],
```

The `StatHat` facade will now be accessible from anywhere in your application:

```
  StatHat::ezCount('', 1);
  StatHat::ezValue('', 15);

  StatHat::count('stat_key', 1);
  StatHat::value('stat_key', 9);
```

### License

[](#license)

©2016 DoSomething.org. StatHat-PHP is free software, and may be redistributed under the terms specified in the [LICENSE](https://github.com/DoSomething/stathat-php/blob/master/LICENSE) file. The name and logo for DoSomething.org are trademarks of Do Something, Inc and may not be used without permission.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~77 days

Total

5

Last Release

3770d ago

Major Versions

v0.0.1 → v1.0.02015-05-05

v1.1.0 → v2.0.02016-03-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/583202?v=4)[David Furnes](/maintainers/DFurnes)[@DFurnes](https://github.com/DFurnes)

---

Top Contributors

[![DFurnes](https://avatars.githubusercontent.com/u/583202?v=4)](https://github.com/DFurnes "DFurnes (30 commits)")[![deezone](https://avatars.githubusercontent.com/u/2119264?v=4)](https://github.com/deezone "deezone (2 commits)")

### Embed Badge

![Health badge](/badges/dosomething-stathat/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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