InstallCommand::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Bencoderus\Webhook\Console;
4
5
use Illuminate\Console\Command;
6
7
class InstallCommand extends Command
8
{
9
    protected $signature = 'webhook:install';
10
11
    protected $description = 'Install Webhook Dependencies';
12
13
    public function handle()
14
    {
15
        $this->info('Installing the webhook service');
16
17
        $this->info('Publishing configuration...');
18
19
        $this->call('vendor:publish', [
20
            '--provider' => "Bencoderus\Webhook\WebhookServiceProvider",
21
            '--tag' => 'config',
22
        ]);
23
24
        if (! class_exists('CreateWebhookLogsTable')) {
25
            $this->call('vendor:publish', [
26
                '--provider' => "Bencoderus\Webhook\WebhookServiceProvider",
27
                '--tag' => 'migrations',
28
            ]);
29
        }
30
31
        $this->info('Webhook service installed successfully.');
32
    }
33
}
34