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

Reinstall::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 8
c 1
b 0
f 1
nc 2
nop 0
dl 0
loc 15
rs 10
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