New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

elegantly/filament-kpi

Plugin for elegantly/laravel-kpi
5,521 3
Install
composer require elegantly/filament-kpi
Latest Version:v5.0.0
PHP:^8.2
Laravel:13
License:MIT
Last Updated:Apr 20, 2026
Links: GitHub  ·  Packagist
Maintainer: QuentinGab

Plugin for elegantly/laravel-kpi

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This plugin allows you to create charts and stats using elegantly/laravel-kpi like this:

use Elegantly\FilamentKpi\Widgets\KpiStat;
use App\Kpis\Users\UsersCountKpi;

KpiStat::kpi(UsersCountKpi::class);
class UsersChart extends KpiChart
{
    protected static string $kpi = UsersCountKpi::class;
}

Installation

You can install the package via composer:

composer require elegantly/filament-kpi

Usage

Display a Kpi Stat

namespace App\Filament\Resources\UserResource\Widgets;

use Elegantly\FilamentKpi\Widgets\KpiStat;
use App\Kpis\Users\UsersCountKpi;
use Filament\Widgets\StatsOverviewWidget;

class UsersStatsOverview extends StatsOverviewWidget
{
    protected static ?string $pollingInterval = null;

    protected function getCards(): array
    {
        return [
            KpiStat::kpi(
                definition: UsersCountKpi::class,
                interval: KpiInterval::Day, // (optional) default to UsersCountKpi::getSnapshotInterval()
                diff: true, // (optional) default to is_subclass_of(UsersCountKpi::class, HasDifference::class)
            ),
        ];
    }
}

Display a Kpi Chart

namespace App\Filament\Resources\UserResource\Widgets;

use Elegantly\FilamentKpi\Widgets\KpiChart;
use App\Kpis\Users\UsersCountKpi;

class UsersChart extends KpiChart
{
    protected static string $kpi = UsersCountKpi::class;
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

elegantly/laravel-kpi

Advanced KPI for your Laravel application

8,254 17
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

651,963,193 9,701
laravel/framework

The Laravel Framework.

610,364,751 34,988
laravel/tinker

Powerful REPL for the Laravel framework.

518,004,183 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

435,097,283 607

Version History

Version Released PHP License
v5.0.0 ^8.2 MIT
v4.0.1 ^8.2 MIT
v4.0.0 ^8.2 MIT
v1.0.0 ^8.2 MIT