ListWebhooks::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Mpociot\CaptainHook\Commands;
4
5
use Illuminate\Console\Command;
6
use Mpociot\CaptainHook\Webhook;
7
8
class ListWebhooks extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'hook:list';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'List all installed webhooks.';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     */
29
    public function handle()
30
    {
31
        $all = Webhook::select('id', 'tenant_id', 'url', 'event')->get();
32
        $this->table(['id', 'tenant_id', 'url', 'event'], $all->toArray());
33
    }
34
}
35