PHPackages                             filahq/statify-easy-widget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. filahq/statify-easy-widget

ActiveLibrary

filahq/statify-easy-widget
==========================

Build Filament stat widgets from Eloquent models with a fluent API.

00PHP

Since Mar 18Pushed 1mo agoCompare

[ Source](https://github.com/FilaHQ/filament-statify-easy-widget)[ Packagist](https://packagist.org/packages/filahq/statify-easy-widget)[ RSS](/packages/filahq-statify-easy-widget/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Statify Easy Widget
===================

[](#statify-easy-widget)

Build Filament stat widgets from Eloquent models with a fluent API.

Installation
------------

[](#installation)

```
composer require filahq/statify-easy-widget
```

Usage
-----

[](#usage)

Extend `EasyStatsWidget` and define your stats in a `stats()` method using the fluent `Stat` builder:

```
use FilaHQ\StatifyEasyWidget\Builder\Stat;
use FilaHQ\StatifyEasyWidget\Widgets\EasyStatsWidget;

class RevenueStatsWidget extends EasyStatsWidget
{
    protected function stats(): array
    {
        return [
            Stat::make('Revenue Today')
                ->model(Order::class)
                ->attribute('total')
                ->where('created_at', '>=', today())
                ->sum()
                ->prefix('$')
                ->color('success')
                ->description('+12% from yesterday')
                ->chartLastDays(7),

            Stat::make('Users Today')
                ->model(User::class)
                ->where('created_at', '>=', today())
                ->count()
                ->color('info')
                ->chartLastDays(30),

            Stat::make('Avg Order Value')
                ->model(Order::class)
                ->attribute('total')
                ->where('created_at', '>=', now()->startOfMonth())
                ->avg()
                ->prefix('$')
                ->suffix(' avg'),
        ];
    }
}
```

Register the widget in your Filament panel as you normally would:

```
$panel->widgets([
    RevenueStatsWidget::class,
]);
```

Builder API
-----------

[](#builder-api)

### Query

[](#query)

MethodDescription`model(string $class)`Eloquent model class to query`attribute(string $column)`Column to aggregate (required for `sum`, `avg`, `min`, `max`)`where(string $column, mixed $value)`Adds a `=` condition`where(string $column, string $operator, mixed $value)`Adds a condition with explicit operator`count()`Aggregate: row count`sum()`Aggregate: column sum`avg()`Aggregate: column average`min()`Aggregate: column minimum`max()`Aggregate: column maximumMultiple `where()` calls accumulate — all conditions are applied to the query.

### Decoration

[](#decoration)

MethodDescription`prefix(string $prefix)`Prepended to the computed value (e.g. `'$'`)`suffix(string $suffix)`Appended to the computed value (e.g. `' users'`)`color(string $color)`Filament color (`'success'`, `'danger'`, `'warning'`, `'info'`, etc.)`icon(string|BackedEnum $icon)`Heroicon name or `Heroicon` enum case`description(string $description)`Secondary label shown below the value`chart(array $data)`Static array of numeric values for the sparkline`chartLastDays(int $days, string $dateColumn = 'created_at')`Generates a sparkline from the last N days of model data### Chart

[](#chart)

`chartLastDays()` automatically builds a sparkline by running the same aggregate for each of the last N days. The same `where()` conditions are applied per day, scoped to that day's date range.

```
// Sparkline from the last 7 days, using created_at (default)
->chartLastDays(7)

// Sparkline from the last 30 days, using a custom date column
->chartLastDays(30, 'completed_at')
```

If both `chart()` and `chartLastDays()` are set, the static `chart()` array takes precedence.

Filament Plugin (optional)
--------------------------

[](#filament-plugin-optional)

If you want to register the plugin with your Filament panel:

```
use FilaHQ\StatifyEasyWidget\StatifyEasyWidgetPlugin;

$panel->plugin(StatifyEasyWidgetPlugin::make());
```

Statify Compatibility
---------------------

[](#statify-compatibility)

Widgets built with `EasyStatsWidget` are compatible with the `filahq/statify` package out of the box. Register them normally and they can be exposed through the Statify API.

```
composer require filahq/statify
```

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance63

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/06780dc3eb62d789cbde0e64cb900e4f2d010d99ec0d3ae35af9ae9b808d8041?d=identicon)[imknight](/maintainers/imknight)

---

Top Contributors

[![imknight](https://avatars.githubusercontent.com/u/77604?v=4)](https://github.com/imknight "imknight (2 commits)")

### Embed Badge

![Health badge](/badges/filahq-statify-easy-widget/health.svg)

```
[![Health](https://phpackages.com/badges/filahq-statify-easy-widget/health.svg)](https://phpackages.com/packages/filahq-statify-easy-widget)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
