feat: total users count on dashboard
This commit is contained in:
@@ -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'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user