Passed
Push — master ( 7d7316...33bfdb )
by Reza
03:46
created

Reinstall   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 11
c 1
b 0
f 1
dl 0
loc 21
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 15 2
1
<?php
2
3
namespace EasyPanel\Commands\Actions;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Artisan;
7
8
class Reinstall extends Command
9
{
10
11
    protected $signature = 'panel:reinstall';
12
    protected $description = 'Reinstall whole the package';
13
14
    public function handle()
15
    {
16
        $status = $this->confirm("Do you really want to reinstall the panel ? (All components will be deleted)", true);
17
        if($status) {
18
            Artisan::call("panel:uninstall", [
19
                '--force' => true,
20
            ]);
21
22
            Artisan::call("panel:install");
23
24
            $this->info("The package was reinstalled!");
25
            return;
26
        }
27
28
        $this->info("The process was canceled");
29
    }
30
}
31