Eloquentize logo
Eloquentize

Core Concepts

Eloquentize is the combinaison of three things:

1 - A small library with a bunch of artisan commands that you will include as a dependency of you projects.

2 - A api used silently by the library, no need to implement it.

3 - A beautiful efficient and customizable dashboard to track metrics from your laravel projects accessible at https://alpha.eloquentize.com

With eloquentize came some concepts, Sources / Lines / Metrics

Source

A source represents a Laravel application identified by its URL and environment.

env('app_url') + env('env')

Line

A line corresponds to:

A source

A periodicity (currently only a complete day)

An eloquent model

An event type (created_at, updated_at, deleted_at)

An operation, by default, count which represents the number of models created during the period, note that it is possible to perform aggregations on the model's properties

An optional โ€œunitโ€ ( USD / EUR / DEGREE )

An optional โ€œdivisorโ€ if you store currency as integer

source periodicity label event type operation unit Divisor
app.myproject.com daily User created_at count NULL NULL
app.myproject.com daily Bill created_at avg_price EUR 100

Metric

A Metric represents a numeric value for a given period and the corresponding line.

// How the base metric is calculated:
User::whereDate('created_at', $yesterday)->count();
// ==> 32 users were created yesterday

Every day, a cron job is executed on one of the servers you want to monitor, and the count statistics are dumped into Eloquentize as Metrics.

Widget

A widget is a collection of metrics linked to lines, which are in turn linked to a source. You can assemble your widgets by choosing the eloquent Models you want to track for a given source. In the above graph, I am only extracting the Report and Patient models to track the evolution of the creations of these two models in my project.

About the author

ยฉ Eloquentize 2024