sakanjo/laravel-easy-metrics
Laravel package to quickly build app metrics (value, trend, bar, line, pie, doughnut, polar). Supports ranges, aggregates (count/sum/min/max/avg), and growth rates. Designed to work with Laravel and Filament widgets for dashboards.
Adopt if:
Look elsewhere if:
sum, avg, count).For Executives: *"This package lets us build data-driven dashboards 10x faster by eliminating manual charting code. For example, a Filament widget showing ‘Monthly Active Users’—which today takes a backend dev 2–4 hours to build—can now be implemented in 15 minutes with this tool. It’s like hiring a junior data analyst for every product team, but without the headcount. We’ll use it to:
For Engineering Leaders: *"This is a force multiplier for our backend team. It turns repetitive tasks—like building ‘users by region’ charts or ‘revenue trends’—into reusable components. Key benefits:
For Developers: *"This package solves the ‘charting hell’ we face when someone asks for ‘a quick graph.’ Here’s how it works:
composer require sakanjo/laravel-easy-metrics.// Old way (error-prone, duplicated)
DB::table('users')->where('created_at', '>=', now()->subDays(30))->count();
With this:
// New way (reusable, typed)
Trend::make(User::class)->countByDays();
Trend or Doughnut and add your logic.
Why it’s better:->withGrowthRate().class UsersChart extends ChartWidget {
public function getData() {
[$labels, $data] = Trend::make(User::class)->countByMonths();
return ['labels' => $labels, 'datasets' => [$data]];
}
}
Let’s use it for [Project X] first to test performance with our dataset size."
How can I help you explore Laravel packages today?