PHPackages                             injic/laravel-statcounter - 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. injic/laravel-statcounter

ActiveLibrary[API Development](/categories/api)

injic/laravel-statcounter
=========================

Laravel integration of the StatCounter API

2.0.3(10y ago)3146MITPHPPHP &gt;=5.4.0

Since Aug 8Pushed 10y ago1 watchersCompare

[ Source](https://github.com/injic/laravel-statcounter)[ Packagist](https://packagist.org/packages/injic/laravel-statcounter)[ Docs](https://github.com/injic/laravel-statcounter)[ RSS](/packages/injic-laravel-statcounter/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (8)Versions (9)Used By (0)

StatCounter API with support for Laravel 5
------------------------------------------

[](#statcounter-api-with-support-for-laravel-5)

[![Latest Stable Version](https://camo.githubusercontent.com/4f44d9e5c237b70f32b9706075313850dd33a6568463ffc6e896f9183aafa6f3/68747470733a2f2f706f7365722e707567782e6f72672f696e6a69632f6c61726176656c2d73746174636f756e7465722f762f737461626c652e737667)](https://packagist.org/packages/injic/laravel-statcounter) [![License](https://camo.githubusercontent.com/d13672bfc02cc9463f4142fbfeee0f00ba23da2323de3b32d23825a669bfca2b/68747470733a2f2f706f7365722e707567782e6f72672f696e6a69632f6c61726176656c2d73746174636f756e7465722f6c6963656e73652e737667)](https://packagist.org/packages/injic/laravel-statcounter)

The package supports use with the [Laravel framework](http://laravel.com/) (v5) providing a `Stat` facade for the [StatCounter API](http://api.statcounter.com/). You can find the documentation for this package [here](https://github.com/injic/laravel-statcounter/wiki/API-Documentation).

---

\###Setup: In order to install, add the following to your `composer.json` file within the `require` block:

```
{
    "require": {
        "injic/laravel-statcounter": "2.*",
    }
}
```

Now, run the command `composer update`.

Within Laravel, locate the file `/config/app.php`. Add the following to the `providers` array:

```
Injic\LaravelStatcounter\LaravelStatcounterServiceProvider::class,
```

Furthermore, add the following the `aliases` array:

```
'Stat' => Injic\LaravelStatcounter\Facades\Stat::class,
```

Publish the configuration

```
$ php artisan vendor:publish --provider="Injic\LaravelStatcounter\LaravelStatcounterServiceProvider"
```

Find the package's config found in `/config/statcounter.php`. You'll need to fill out your StatCounter username, API password, and project information. Since the config file contains further information on the individual values, here are a few things to note:

- `username` is the case-sensitive login username for StatCounter
- `password` referes to the API password, **not** the login password (see [API Password](http://api.statcounter.com/password))
- `default` must match one of the project names under `projects`
- `your-project-name` is the only value that isn't specified by StatCounter. It's an alias of your choosing used when calling functions which handle projects.
- `projects` and `security-codes` must having matching keys (i.e. the project names).

---

\###Usage:

Methods of the `Stat` class simplify what is needed for a StatCounter API query as described in the [StatCounter API Documentation](http://api.statcounter.com/docs/v3). Additionally, the `Stat` class was modeled off of the [Laravel DB Query](http://laravel.com/docs/queries) design, and you may expect similar methods.

You can find the documentation for this package [here](https://github.com/injic/laravel-statcounter/wiki/API-Documentation).

---

\###Examples:

```
// Retrieve an array of browser objects (http://api.statcounter.com/docs/v3#browsers)
$stats = Stat::browsers()->get();

// Retrieve an array of summary objects (http://api.statcounter.com/docs/v3#summary-daily)
$now = \Carbon\Carbon::now(); // http://carbon.nesbot.com/
$stats = Stat::summary()->setRange(Granularity::DAILY, $now->subWeek(), $now)->get();

// Paginate the recent visitor objects (http://api.statcounter.com/docs/v3#visitors)
// https://laravel.com/docs/5.2/pagination
$stats = Stat::recentVisitors()->paginate(20);

// Add new project to StatCounter with the project name, project url, and project timezone
$project Stat::addProject('project-name','www.example.com','America/Chicago');
```

```

{!! Stat::tracker() !!}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Recently: every ~141 days

Total

8

Last Release

3775d ago

Major Versions

v1.3.0 → 2.0.02016-02-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8323230?v=4)[James M Irvine](/maintainers/jamesmirvine)[@jamesmirvine](https://github.com/jamesmirvine)

---

Top Contributors

[![jamesmirvine](https://avatars.githubusercontent.com/u/8323230?v=4)](https://github.com/jamesmirvine "jamesmirvine (27 commits)")

---

Tags

laravelstatcounter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/injic-laravel-statcounter/health.svg)

```
[![Health](https://phpackages.com/badges/injic-laravel-statcounter/health.svg)](https://phpackages.com/packages/injic-laravel-statcounter)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[neuron-core/neuron-laravel

Official Neuron AI Laravel SDK.

11337.8k1](/packages/neuron-core-neuron-laravel)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6279.6k5](/packages/riclep-laravel-storyblok)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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