Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | class Uninstall extends Command |
||
11 | { |
||
12 | |||
13 | protected $signature = 'panel:uninstall {--f|force : Force mode}'; |
||
14 | protected $description = 'Uninstall the panel'; |
||
15 | |||
16 | public function handle() |
||
17 | { |
||
18 | $status = $this->option('force') ? true : $this->confirm("Do you really want to uninstall the panel ? (All files and components will be deleted)", true); |
||
19 | |||
20 | if (!$status) { |
||
21 | $this->info("The process was canceled"); |
||
22 | return; |
||
23 | } |
||
24 | |||
25 | // Delete folders and files which EasyPanel published |
||
26 | $this->deleteFiles(); |
||
27 | |||
28 | // Drop tables which has been created by EasyPanel |
||
29 | $this->dropTables(); |
||
30 | |||
31 | $this->info("All files and components was deleted!"); |
||
32 | } |
||
33 | |||
34 | private function dropTables() |
||
35 | { |
||
36 | Schema::dropIfExists('cruds'); |
||
37 | Schema::dropIfExists('panel_admins'); |
||
38 | } |
||
39 | |||
40 | private function deleteFiles() |
||
50 | } |
||
51 | |||
52 | |||
54 |