feat: total users count on dashboard

This commit is contained in:
2026-05-24 10:37:16 +02:00
parent 2bdffccea2
commit 24ec4165a6
4 changed files with 76 additions and 0 deletions
@@ -0,0 +1,30 @@
<?php
namespace App\Filament\Widgets;
use App\Models\User;
use Filament\Support\Icons\Heroicon;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
class TotalUsersOverview extends StatsOverviewWidget
{
protected static ?int $sort = -2;
protected static bool $isLazy = false;
protected ?string $pollingInterval = null;
/**
* @return array<Stat>
*/
protected function getStats(): array
{
return [
Stat::make(__('admin.widgets.total_users.label'), User::query()->count())
->description(__('admin.widgets.total_users.description'))
->icon(Heroicon::Users)
->color('primary'),
];
}
}