PHPackages                             moirei/eloquent-metrics - 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. [Database &amp; ORM](/categories/database)
4. /
5. moirei/eloquent-metrics

ActiveLibrary[Database &amp; ORM](/categories/database)

moirei/eloquent-metrics
=======================

Retrieve metric data on Eloquent Models for analytics.

0.4.0(3mo ago)0643MITPHPPHP ^8.2

Since Jun 3Pushed 3mo agoCompare

[ Source](https://github.com/moirei/eloquent-metrics)[ Packagist](https://packagist.org/packages/moirei/eloquent-metrics)[ Docs](https://moirei.github.io/eloquent-metrics)[ RSS](/packages/moirei-eloquent-metrics/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (14)Versions (7)Used By (0)

Eloquent Metrics
================

[](#eloquent-metrics)

All documentation is available at [the documentation site](https://moirei.github.io/eloquent-metrics).

Example

```
...
use MOIREI\Metrics\Trend;

$metrics = Trend::make()
            ->name('Order Sales')
            ->period('week') // sample a week ago intil now
            ->add('previous-period') // add a comparison period
            ->sumByDays(\App\Models\Order::class, 'total');
```

Example with [moirei/hogql](https://github.com/moirei/hogql)

```
...
$query = HogQl::eloquent()->where('event', '$pageview');

$metrics = Trend::make()
            ->name('Page views')
            ->period('week')
            ->add('previous-period')
            ->sumByDays($query);
```

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

[](#installation)

```
composer require moirei/eloquent-metrics
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](./CHANGELOG.md).

Credits
-------

[](#credits)

- [Augustus Okoye](https://github.com/augustusnaz)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Recently: every ~376 days

Total

6

Last Release

104d ago

PHP version history (2 changes)0.1.0PHP ^7.2|^8.0

0.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ac6a15a7b2f9055a98e4419e0d2820f72db3567706837ec388baee535d3e3e7?d=identicon)[moirei](/maintainers/moirei)

---

Top Contributors

[![augustusnaz](https://avatars.githubusercontent.com/u/51074349?v=4)](https://github.com/augustusnaz "augustusnaz (7 commits)")

---

Tags

laraveleloquentMetricsanalyticschartjschartschartisanmoirei

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/moirei-eloquent-metrics/health.svg)

```
[![Health](https://phpackages.com/badges/moirei-eloquent-metrics/health.svg)](https://phpackages.com/packages/moirei-eloquent-metrics)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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