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.1(2mo ago)2624.3k↑100.5%7MITPHPPHP ^8.3|^8.4CI passing

Since Mar 26Pushed 1w 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 2d ago

READMEChangelog (10)Dependencies (43)Versions (18)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://github.com/spatie/filament-simple-stats/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/filament-simple-stats/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://github.com/spatie/filament-simple-stats/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](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

58

—

FairBetter than 98% of packages

Maintenance92

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 51.2% 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 ~74 days

Recently: every ~57 days

Total

11

Last Release

86d 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)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (20 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 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)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (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-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[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.

329530.5k29](/packages/codewithdennis-filament-select-tree)[spatie/laravel-data

Create unified resources and data transfer objects

1.8k35.2M968](/packages/spatie-laravel-data)[leandrocfe/filament-apex-charts

Apex Charts integration for Filament PHP.

4911.6M11](/packages/leandrocfe-filament-apex-charts)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)

PHPackages © 2026

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