Retrieve metric data on Eloquent Models for analytics.
moirei/eloquent-metrics is a Laravel package for retrieve metric data on eloquent models for analytics..
It currently has 0 GitHub stars and 643 downloads on Packagist (latest version 0.4.0).
Install it with composer require moirei/eloquent-metrics.
Discover more Laravel packages by moirei
or browse all Laravel packages to compare alternatives.
Last updated
All documentation is available at the documentation site.
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
...
$query = HogQl::eloquent()->where('event', '$pageview');
$metrics = Trend::make()
->name('Page views')
->period('week')
->add('previous-period')
->sumByDays($query);
composer require moirei/eloquent-metrics
Please see CHANGELOG.
The MIT License (MIT). Please see License File for more information.