31 lines
737 B
PHP
31 lines
737 B
PHP
<?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'),
|
|
];
|
|
}
|
|
}
|