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(1mo ago)0643MITPHPPHP ^8.2

Since Jun 3Pushed 1mo 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 yesterday

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

45

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

52d 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

[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)

PHPackages © 2026

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