1 | <?php |
||
8 | class ForgeCredentials extends Command |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'forge:credentials'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Display Forge credentials'; |
||
23 | |||
24 | /** |
||
25 | * Execute the console command. |
||
26 | * |
||
27 | * @return mixed |
||
28 | */ |
||
29 | public function handle(Forge $forge) |
||
30 | { |
||
31 | $credentials = $forge->credentials(); |
||
32 | |||
33 | $headers = ['ID', 'Name', 'Provider']; |
||
34 | $rows = collect($credentials)->map(function ($credential) { |
||
35 | return [$credential['id'], $credential['name'], $credential['type']]; |
||
36 | }); |
||
37 | |||
38 | $this->table($headers, $rows->toArray()); |
||
39 | } |
||
40 | } |
||
41 |