spatie/filament-simple-stats
Opinionated prebuilt stat widgets for Filament dashboards that combine Filament's Stat widgets with laravel-trend, so you can quickly show daily counts or sums for a model over the last 30 days with just a few lines of code.
last30Days(), dailyCount(), dailySum(), where(), withoutTrend(), invertTrendColors()) effectively defines the feature boundary of "simple stats." That is useful for saying no: if a stakeholder asks for cohort analysis, custom date-range pickers, or multi-series comparisons, that is a different (larger) feature, not a tweak.invertTrendColors() is a direct product lever for cost/error-rate/churn metrics where down is up. Use this as the forcing function to get metric owners to agree on directionality before the dashboard ships.Good fit when:
where clause. The where('user_id', auth()->id()) pattern covers the common "scoped to current user/tenant" case.flowframe/laravel-trend rather than depending on it, which meaningfully reduces supply-chain surface area.Look elsewhere when:
last30Days()), not an interactive picker. If stakeholders expect to explore data, that is a reporting product, not a stat widget.dailySum() on a dashboard that loads on every page view is a performance risk your engineering team must own. Ask specifically about query cost and caching before adopting on high-traffic admin panels.Adoption checklist for engineering: confirm Filament version compatibility, index the columns used in where and date-range aggregation, confirm whether trend queries double the query load per card, and confirm timezone handling for "daily" buckets (a recurring source of subtly wrong dashboards).
For executives: We can stand up the internal dashboard's headline numbers — new users, revenue, activity, error counts — in roughly a day of engineering instead of a sprint, using a free, MIT-licensed, Spatie-maintained component that runs entirely inside our own infrastructure. There is no vendor, no per-seat cost, and no data sharing. It gives us a cheap way to test whether the dashboard is actually used before we commit budget to a real reporting product. The trade-off is deliberate: it handles simple counts and totals with trend arrows, not custom analytics. If the business needs explorable, filterable reporting, that is a separate, larger investment — and this package helps us find out whether that investment is warranted.
For engineering: It is a thin wrapper combining Filament's native Stat widget with trend aggregation, configured declaratively inside an existing widget class (SimpleStat::make(Model::class)->last30Days()->dailyCount()). It supports where() scoping and Eloquent builders, and lets you disable trends or invert trend colors per card. As of 1.2.0 it inlines flowframe/laravel-trend and tracks current Laravel/Filament releases. It is small and easy to replace — the main things to verify before merge are index coverage on the aggregated columns and the per-page-load query cost, since each trend card implies a comparison-period query as well.
How can I help you explore Laravel packages today?