44 lines
872 B
PHP
44 lines
872 B
PHP
<?php
|
|
|
|
namespace App\Support\Plugins\Dashboard\Widgets;
|
|
|
|
use App\Repositories\User\UserRepository;
|
|
use App\Support\Enum\UserStatus;
|
|
use Vanguard\Plugins\Widget;
|
|
|
|
class BannedUsers extends Widget
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public ?string $width = '3';
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected string|\Closure|array $permissions = 'users.manage';
|
|
|
|
public function __construct(protected readonly UserRepository $users) {}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function component(): string
|
|
{
|
|
return 'StatWidget';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function data(): array
|
|
{
|
|
return [
|
|
'label' => __('Banned Users'),
|
|
'count' => $this->users->countByStatus(UserStatus::BANNED),
|
|
'icon' => 'fa fa-user-slash',
|
|
'tone' => 'danger',
|
|
];
|
|
}
|
|
}
|