GetAdmins::handle()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
c 0
b 0
f 0
nc 3
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
namespace EasyPanel\Commands\UserActions;
4
5
use EasyPanel\Support\Contract\UserProviderFacade;
6
use Illuminate\Console\Command;
7
8
class GetAdmins extends Command
9
{
10
11
    protected $description = 'Get Admins list';
12
    protected $signature = 'panel:admins';
13
14
    public function handle()
15
    {
16
        $admins = UserProviderFacade::getAdmins();
17
        $this->warn('Admin Lists :');
18
        foreach ($admins as $admin){
19
            $message = $admin->panelAdmin->is_superuser
20
                ? "• {$admin->name}: {$admin->email} ( Super Admin ✅ )"
21
                : "• {$admin->name}: {$admin->email}";
22
23
            $this->warn($message);
24
        }
25
    }
26
}
27