1 | <?php |
||
7 | class Clear extends Base |
||
8 | { |
||
9 | /** |
||
10 | * The console command name. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $name = 'firewall:clear'; |
||
15 | |||
16 | /** |
||
17 | * The console command description. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $description = 'Remove all ip addresses from white and black lists.'; |
||
22 | |||
23 | /** |
||
24 | * Clear the list. |
||
25 | * |
||
26 | * @return mixed |
||
27 | */ |
||
28 | 1 | public function fire() |
|
29 | { |
||
30 | 1 | if (!$this->option('force')) { |
|
31 | $this->error('This command won\'t run unless you use --force.'); |
||
32 | } else { |
||
33 | 1 | if (app('firewall')->clear()) { |
|
34 | 1 | $this->info('List cleared.'); |
|
35 | } else { |
||
36 | $this->info('There were no IP addresses to be deleted.'); |
||
37 | } |
||
38 | } |
||
39 | 1 | } |
|
40 | |||
41 | /** |
||
42 | * Get the console command options. |
||
43 | * |
||
44 | * @return array |
||
45 | */ |
||
46 | 24 | protected function getOptions() |
|
52 | } |
||
53 |