PHPackages                             fr3nch13/cakephp-stats - 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. fr3nch13/cakephp-stats

ActiveCakephp-plugin

fr3nch13/cakephp-stats
======================

Statistics plugin for CakePHP Projects

0.3(2y ago)02.3k[1 PRs](https://github.com/fr3nch13/cakephp-stats/pulls)MITPHP

Since Oct 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fr3nch13/cakephp-stats)[ Packagist](https://packagist.org/packages/fr3nch13/cakephp-stats)[ Docs](https://github.com/fr3nch13/cakephp-stats)[ RSS](/packages/fr3nch13-cakephp-stats/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (6)Used By (0)

CakePHP Stats Plugin
====================

[](#cakephp-stats-plugin)

[![Build Status](https://github.com/fr3nch13/cakephp-stats/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fr3nch13/cakephp-stats/actions/workflows/ci.yml)[![Total Downloads](https://camo.githubusercontent.com/17c7a235adcb93109b25e9f21750cba167df6c6c5ff5adf4e6c13c4881da232c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6672336e636831332f63616b657068702d73746174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3nch13/cakephp-stats)[![PHPStan](https://camo.githubusercontent.com/fff00cebb924e124a7335e6bd8ca8f8cf38869463c1654eff45d0939f1f21c57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpstan/phpstan)[![codecov](https://camo.githubusercontent.com/b383f540bd801df940969491c34354a86c45bd12d1b4f9199b09f2de40db5017/68747470733a2f2f636f6465636f762e696f2f67682f6672336e636831332f63616b657068702d73746174732f67726170682f62616467652e7376673f746f6b656e3d78484330786a4c587871)](https://codecov.io/gh/fr3nch13/cakephp-stats)

Used to track and display statistics, and Trends.

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require fr3nch13/cakephp-stats
```

Usage
-----

[](#usage)

This all revolves around the event listener [`StatsListener`](src/Event/StatsListener.php).

To use this plugin, you need to extend the `StatsListener`, and define your `StatsObject` `keys` in it. As an example of how to extend the `StatsListener` and define your `objects`.

See [CakePHP's Event System](https://book.cakephp.org/5/en/core-libraries/events.html#events-system)

src/Event/TestListener.php:

```
