PHPackages                             spatie/filament-simple-stats - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. spatie/filament-simple-stats

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spatie/filament-simple-stats
============================

Opinionated prebuilt stat widgets to quickly add to your Filament dashboards.

1.2.0(2mo ago)2317.9k↓37.5%6[1 PRs](https://github.com/spatie/filament-simple-stats/pulls)MITPHPPHP ^8.3|^8.4CI passing

Since Mar 26Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/spatie/filament-simple-stats)[ Packagist](https://packagist.org/packages/spatie/filament-simple-stats)[ Docs](https://github.com/spatie/filament-simple-stats)[ GitHub Sponsors](https://github.com/Spatie)[ RSS](/packages/spatie-filament-simple-stats/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (29)Versions (16)Used By (0)

Opinionated prebuilt stat widgets to quickly add to your Filament dashboards.
=============================================================================

[](#opinionated-prebuilt-stat-widgets-to-quickly-add-to-your-filament-dashboards)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4916cc02c076882dddab891d450ffac3e494342d89a6338dfea5ab3db745aa51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f66696c616d656e742d73696d706c652d73746174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/filament-simple-stats)[![GitHub Tests Action Status](https://camo.githubusercontent.com/af4be9c857a8f3d7f1c05d8e09b8c1476b7b53b8306cc16748923d748914b99f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f66696c616d656e742d73696d706c652d73746174732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/filament-simple-stats/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f2715b39e42097c300088676775d6dfc5ee04f418947d2b5d78ffcf4939781d4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f66696c616d656e742d73696d706c652d73746174732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/spatie/filament-simple-stats/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/223c619a3a78983d6165683ac493488393e3f1dcfdfe0fbce55ad595af2772e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f66696c616d656e742d73696d706c652d73746174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/filament-simple-stats)

Opinionated prebuilt stat widgets to quickly add to your Filament dashboards. This package combines the power of Filament Stat widgets and the [Flowframe/laravel-trend](https://github.com/Flowframe/laravel-trend) package to provide you with a simple way to add stats to your Filament dashboards.

[![](https://github.com/spatie/filament-simple-stats/raw/main/example.png)](https://github.com/spatie/filament-simple-stats/blob/main/example.png)

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/a592ee417358a6857a593bce76abbf53dca7fcafa3330b6cb40e796d00604f38/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f66696c616d656e742d73696d706c652d73746174732e6a70673f743d31)](https://spatie.be/github-ad-click/filament-simple-stats)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require spatie/filament-simple-stats
```

Usage
-----

[](#usage)

Inside your Filament Widget class:

```
protected function getStats(): array
    {
        return [
            SimpleStat::make(User::class)->last30Days()->dailyCount(),
            SimpleStat::make(Purchase::class)->last30Days()->dailySum('earnings'),
        ];
    }
```

### Modify the query

[](#modify-the-query)

You can use the `where` method to change the query. For example, to only show stats related to a specific user:

```
protected function getStats(): array
    {
        return [
            SimpleStat::make(Purchase::class)->where('user_id', auth()->id())->last30Days()->dailySum('earnings'),
        ];
    }
```

### Trends

[](#trends)

By default, stats display period-over-period trends showing whether values have increased or decreased compared to the previous period.

Upward trends are displayed with a green color and an upward arrow icon, while downward trends are displayed with a red color and a downward arrow icon. The percentage change is automatically calculated and displayed in the description.

#### Disabling trends

[](#disabling-trends)

You can disable trends using the `withoutTrend()` method:

```
protected function getStats(): array
    {
        return [
            SimpleStat::make(User::class)->last30Days()->dailyCount()->withoutTrend(),
        ];
    }
```

#### Inverting trend colors

[](#inverting-trend-colors)

For metrics where a decrease is positive (like error rates or costs), you can invert the color scheme using `invertTrendColors()`:

```
protected function getStats(): array
    {
        return [
            SimpleStat::make(Error::class)
                ->last30Days()
                ->dailyCount()
                ->invertTrendColors(), // Downward trend = green, upward trend = red
        ];
    }
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Tim Van Dijck](https://github.com/timvandijck)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance84

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 61.5% 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.

###  Release Activity

Cadence

Every ~80 days

Total

10

Last Release

61d ago

Major Versions

0.2.1 → 1.0.02025-12-08

PHP version history (3 changes)0.1.0PHP ^8.2|^8.3

0.2.1PHP ^8.2|^8.3|^8.4

1.2.0PHP ^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![timvandijck](https://avatars.githubusercontent.com/u/4528796?v=4)](https://github.com/timvandijck "timvandijck (64 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (7 commits)")[![KeizerDev](https://avatars.githubusercontent.com/u/4026917?v=4)](https://github.com/KeizerDev "KeizerDev (3 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![DirtyRacer1337](https://avatars.githubusercontent.com/u/17379553?v=4)](https://github.com/DirtyRacer1337 "DirtyRacer1337 (1 commits)")[![AndreVME](https://avatars.githubusercontent.com/u/28352370?v=4)](https://github.com/AndreVME "AndreVME (1 commits)")

---

Tags

spatielaravelfilamentfilament-simple-stats

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spatie-filament-simple-stats/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-filament-simple-stats/health.svg)](https://phpackages.com/packages/spatie-filament-simple-stats)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[leandrocfe/filament-apex-charts

Apex Charts integration for Filament PHP.

4861.2M8](/packages/leandrocfe-filament-apex-charts)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

320392.1k17](/packages/codewithdennis-filament-select-tree)[spatie/laravel-support-bubble

A non-intrusive support chat bubble that can be displayed on any page

391173.6k](/packages/spatie-laravel-support-bubble)[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)

PHPackages © 2026

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