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.
Architecture fit
SimpleStat::make(Model::class) wraps Filament's native Stat widget and an inlined flowframe/laravel-trend engine. No service provider to configure, no migrations, no published config, no routes — it is a view-layer convenience, not an infrastructure dependency.getStats() method on an existing Filament Widget, so it composes with the dashboard architecture already in place rather than introducing a parallel reporting stack.last30Days()), fixed granularity (dailyCount, dailySum), and auto-computed period-over-period trends. Teams needing weekly/monthly cohorts, multi-series charts, or custom formatting will outgrow it quickly.Integration feasibility
composer require spatie/filament-simple-stats and two lines of widget code — the smallest integration surface I have assessed in this category. A working spike is a half-day including review.where() scoping, which is the escape hatch that makes it viable for multi-tenant and per-user views (->where('user_id', auth()->id())).withoutTrend() and invertTrendColors() cover the two most common semantic objections (no comparison baseline; metrics where down is good), so the opinionated defaults are negotiable at the widget level.Stat widget is a contained refactor, not a migration.Technical risk
filament/widgets from ^4.0 to ^5.2 and a Laravel 13 track. Filament's package split and major cadence mean your Filament upgrade and this package's upgrade must be sequenced together.laravel-trend was inlined in 1.2.0 — good for dependency count, but it also removes your ability to patch trend behavior independently.endOfDay handling of "today", timezone/DST boundaries) is asserted by the package, not configurable. Verify against raw SQL before trusting the arrow direction in a demo.Key questions
created_at plus each filtered column for the models we plan to surface?where()?Stack fit
Migration path
composer remove plus deleting the widget class.Stat widget with the equivalent query first, then swap in SimpleStat and diff the numbers. This produces the ground-truth baseline for trend validation at almost no cost.Compatibility
composer.json and let Dependabot surface bumps as reviewable PRs (the repo already runs this cadence).Sequencing
where(), withoutTrend(), and invertTrendColors() per metric semantics.Maintenance
Support
Scaling
(filter_column, created_at); narrow the window; cache widget output; move heavy metrics to a scheduled snapshot table. Note the package offers no built-in caching, so any of these is custom work.where() scoping multiply query count by concurrency; watch the database before the panel, not the PHP layer.Failure modes
How can I help you explore Laravel packages today?