@@ -80,7 +80,7 @@ |
||
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | - foreach ($categories as $category){ |
|
83 | + foreach ($categories as $category) { |
|
84 | 84 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
85 | 85 | ->where('category_id', $category->id) |
86 | 86 | ->orderBy('netlogin', 'desc') |
@@ -72,28 +72,28 @@ |
||
72 | 72 | * |
73 | 73 | * @return mixed |
74 | 74 | */ |
75 | - public function handle() |
|
76 | - { |
|
77 | - $categories = Category::get(); |
|
75 | + public function handle() |
|
76 | + { |
|
77 | + $categories = Category::get(); |
|
78 | 78 | |
79 | - if ($categories->isEmpty()) { |
|
80 | - $this->info("No categories to export"); |
|
81 | - return; |
|
82 | - } |
|
79 | + if ($categories->isEmpty()) { |
|
80 | + $this->info("No categories to export"); |
|
81 | + return; |
|
82 | + } |
|
83 | 83 | |
84 | - foreach ($categories as $category){ |
|
85 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
84 | + foreach ($categories as $category){ |
|
85 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
86 | 86 | ->where('category_id', $category->id) |
87 | 87 | ->orderBy('netlogin', 'desc') |
88 | 88 | ->get(); |
89 | 89 | |
90 | - $name = static::stringNormalise($category->name); |
|
91 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
90 | + $name = static::stringNormalise($category->name); |
|
91 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
92 | 92 | |
93 | - $count = $this->exportAccount($accounts, $filename, false, $this->option('ci')); |
|
93 | + $count = $this->exportAccount($accounts, $filename, false, $this->option('ci')); |
|
94 | 94 | |
95 | - $url = $this->storage->path($filename); |
|
96 | - $this->info("{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
97 | - } |
|
98 | - } |
|
95 | + $url = $this->storage->path($filename); |
|
96 | + $this->info("{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
97 | + } |
|
98 | + } |
|
99 | 99 | } |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | protected $description = 'Export accounts, groups and categories at once'; |
24 | 24 | |
25 | 25 | protected $commands = [ |
26 | - 'export:accounts', |
|
27 | - 'export:groups', |
|
28 | - 'export:categories' |
|
26 | + 'export:accounts', |
|
27 | + 'export:groups', |
|
28 | + 'export:categories' |
|
29 | 29 | ]; |
30 | 30 | |
31 | 31 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | public function handle() |
47 | 47 | { |
48 | 48 | foreach ($this->commands as $cmd) { |
49 | - $this->call($cmd, [ |
|
49 | + $this->call($cmd, [ |
|
50 | 50 | '--ci' => $this->option('ci') |
51 | - ]); |
|
51 | + ]); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | } |
@@ -47,19 +47,19 @@ |
||
47 | 47 | |
48 | 48 | $flagCI = $this->option('ci'); |
49 | 49 | if ($flagCI === false) { |
50 | - $bar = $this->output->createProgressBar($count); |
|
50 | + $bar = $this->output->createProgressBar($count); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | foreach ($accounts as $account) { |
54 | 54 | $account->disable(); |
55 | 55 | if (isset($bar)) { |
56 | - $bar->advance(); |
|
56 | + $bar->advance(); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | if (isset($bar)) { |
61 | - $bar->finish(); |
|
62 | - $this->info("\n"); |
|
61 | + $bar->finish(); |
|
62 | + $this->info("\n"); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->info("{$count} accounts disabled"); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $count = count($accounts); |
12 | 12 | |
13 | 13 | if ($flagCI === false) { |
14 | - $bar = $this->output->createProgressBar($count); |
|
14 | + $bar = $this->output->createProgressBar($count); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | foreach ($accounts as $account) { |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | $record .= $password ? ":{$account->netpass}" : ''; |
20 | 20 | $this->storage->prepend($filename, $record); |
21 | 21 | if (isset($bar)) { |
22 | - $bar->advance(); |
|
22 | + $bar->advance(); |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
26 | 26 | if (isset($bar)) { |
27 | - $bar->finish(); |
|
28 | - $this->info("\n"); |
|
27 | + $bar->finish(); |
|
28 | + $this->info("\n"); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return $count; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | public function handle() |
82 | 82 | { |
83 | 83 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
84 | - ->orderBy('netlogin', 'desc')->get(); |
|
84 | + ->orderBy('netlogin', 'desc')->get(); |
|
85 | 85 | |
86 | 86 | if ($accounts->isEmpty() && !$this->option('empty')) { |
87 | 87 | $this->info("No accounts to export"); |