Conditions | 6 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function handle() |
||
16 | { |
||
17 | $names = (array) $this->argument('name') ?: config('easy_panel.actions', []); |
||
18 | if($names == null) { |
||
19 | throw new CommandNotFoundException("There is no action in config file"); |
||
20 | } |
||
21 | |||
22 | foreach ($names as $name) { |
||
23 | if (!in_array($name, config('easy_panel.actions'))) { |
||
24 | $this->line("$name does not exist in config file"); |
||
25 | continue; |
||
26 | } |
||
27 | |||
28 | if ($this->askResult($name)) { |
||
29 | File::deleteDirectory(resource_path("/views/livewire/admin/$name")); |
||
30 | File::deleteDirectory(app_path("/Http/Livewire/Admin/" . ucfirst($name))); |
||
31 | $this->info("{$name} files were deleted, make sure you will delete {$name} value from actions in config"); |
||
32 | } else { |
||
33 | $this->line("process for {$name} action was canceled."); |
||
34 | } |
||
49 |