spatie/filament-simple-stats
Opinionated prebuilt stat widgets for Filament dashboards. Quickly add counts and sums with ready-made Stat widgets powered by Flowframe/laravel-trend, including last 30 days trends (daily/weekly) for models and fields.
Pros:
laravel-trend: Eliminates external dependency on flowframe/laravel-trend (~100KB reduction), simplifying maintenance and reducing transitive dependency risks.Cons:
laravel-trend is now bundled, customizations to trend logic (e.g., advanced aggregations) may require deeper forks.laravel-trend reduces composer complexity and eliminates version conflicts with other packages using the same dependency.date_trunc).laravel-trend: Internal API changes to the bundled trend logic could break custom implementations relying on flowframe/laravel-trend’s public methods.laravel-trend may introduce subtle query optimizations or regressions. Profile trend queries post-upgrade.laravel-trend beyond default usage (e.g., custom aggregations)? If yes, test thoroughly after inlining.registerWidgets() method changes).laravel-trend inlined, are there opportunities to optimize trend queries further (e.g., database-specific functions)?laravel-trend who want to simplify dependencies.composer require laravel/framework:^13.0
composer require filament/filament:"^3.0"
composer require spatie/filament-simple-stats:"^1.2"
registerWidgets() remains stable):
public function panel(Panel $panel): Panel
{
return $panel->widgets([
Total::make('Users', User::query()->count()),
Trend::make('Users', User::query()->trend('count', 'daily')),
]);
}
assertDatabaseHas).flowframe/laravel-trend from composer.json (now bundled).whereBetween syntax).filament-simple-stats to 1.2.0 and test basic widgets.laravel-trend reduces composer updates and conflict risks.laravel-trend now require patching the vendor codebase (risk of merge conflicts).vendor:publish to inspect bundled laravel-trend config if customizations are needed.laravel-trend: May include optimizations for Laravel 13 (e.g., improved query caching). Profile post-upgrade.created_at/updated_at columns used in trend queries.| Failure Point | Impact | Mitigation |
|---|---|---|
| Laravel 13 breaking changes | Widget/dependency failures | Test in staging; use up command for safe upgrades. |
Inlined laravel-trend bugs |
Incorrect trend calculations | Fork the package if critical fixes are needed. |
| Filament v3 API changes | Widget registration failures | Review Filament’s v3 migration guide. |
| Database query regressions | Slow dashboard load | Profile with Laravel 13’s DB::enableQueryLog(). |
| Caching misconfiguration | Stale data | Use cache()->forever() for critical stats. |
How can I help you explore Laravel packages today?