@@ -13,12 +13,12 @@ |
||
| 13 | 13 | const ACCOUNT_ENABLE = 1; |
| 14 | 14 | |
| 15 | 15 | const ACCOUNT_STATUS = [ |
| 16 | - 0 => [ 'text' => 'accounts.disabled', |
|
| 16 | + 0 => ['text' => 'accounts.disabled', |
|
| 17 | 17 | 'icon' => 'fa-ban', |
| 18 | - 'unicon' => '' ], |
|
| 19 | - 1 => [ 'text' => 'accounts.enabled', |
|
| 18 | + 'unicon' => ''], |
|
| 19 | + 1 => ['text' => 'accounts.enabled', |
|
| 20 | 20 | 'icon' => 'fa-globe', |
| 21 | - 'unicon' => '' ] |
|
| 21 | + 'unicon' => ''] |
|
| 22 | 22 | ]; |
| 23 | 23 | |
| 24 | 24 | const SEARCH_CRITERIA = [ |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | public function handle() |
| 63 | 63 | { |
| 64 | 64 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
| 65 | - ->orderBy('netlogin', 'desc')->get(); |
|
| 65 | + ->orderBy('netlogin', 'desc')->get(); |
|
| 66 | 66 | |
| 67 | 67 | if ($accounts->isEmpty()) { |
| 68 | 68 | $this->info("No accounts to export"); |
@@ -55,32 +55,32 @@ |
||
| 55 | 55 | * |
| 56 | 56 | * @return mixed |
| 57 | 57 | */ |
| 58 | - public function handle() |
|
| 59 | - { |
|
| 60 | - $categories = Category::get(); |
|
| 58 | + public function handle() |
|
| 59 | + { |
|
| 60 | + $categories = Category::get(); |
|
| 61 | 61 | |
| 62 | - if ($categories->isEmpty()) { |
|
| 63 | - $this->info("No categories to export"); |
|
| 64 | - return; |
|
| 65 | - } |
|
| 62 | + if ($categories->isEmpty()) { |
|
| 63 | + $this->info("No categories to export"); |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - foreach ($categories as $category){ |
|
| 68 | - $name = static::stringNormalise($category->name); |
|
| 69 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 67 | + foreach ($categories as $category){ |
|
| 68 | + $name = static::stringNormalise($category->name); |
|
| 69 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 71 | 71 | ->where('category_id', $category->id) |
| 72 | 72 | ->orderBy('netlogin', 'desc') |
| 73 | 73 | ->get(); |
| 74 | - Storage::disk('export')->put($filename, ''); |
|
| 75 | - $count = count($accounts); |
|
| 76 | - $bar = $this->output->createProgressBar($count); |
|
| 77 | - foreach ($accounts as $account) { |
|
| 78 | - Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | - $bar->advance(); |
|
| 80 | - } |
|
| 81 | - $bar->finish(); |
|
| 82 | - $url = Storage::disk('export')->path($filename); |
|
| 83 | - $this->info("\n{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
| 84 | - } |
|
| 85 | - } |
|
| 74 | + Storage::disk('export')->put($filename, ''); |
|
| 75 | + $count = count($accounts); |
|
| 76 | + $bar = $this->output->createProgressBar($count); |
|
| 77 | + foreach ($accounts as $account) { |
|
| 78 | + Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | + $bar->advance(); |
|
| 80 | + } |
|
| 81 | + $bar->finish(); |
|
| 82 | + $url = Storage::disk('export')->path($filename); |
|
| 83 | + $this->info("\n{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | 86 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - foreach ($categories as $category){ |
|
| 67 | + foreach ($categories as $category) { |
|
| 68 | 68 | $name = static::stringNormalise($category->name); |
| 69 | 69 | $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
| 70 | 70 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
@@ -55,32 +55,32 @@ |
||
| 55 | 55 | * |
| 56 | 56 | * @return mixed |
| 57 | 57 | */ |
| 58 | - public function handle() |
|
| 59 | - { |
|
| 60 | - $groups = Group::get(); |
|
| 58 | + public function handle() |
|
| 59 | + { |
|
| 60 | + $groups = Group::get(); |
|
| 61 | 61 | |
| 62 | - if ($groups->isEmpty()) { |
|
| 63 | - $this->info("No groups to export"); |
|
| 64 | - return; |
|
| 65 | - } |
|
| 62 | + if ($groups->isEmpty()) { |
|
| 63 | + $this->info("No groups to export"); |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - foreach ($groups as $group){ |
|
| 68 | - $name = static::stringNormalise($group->name); |
|
| 69 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 67 | + foreach ($groups as $group){ |
|
| 68 | + $name = static::stringNormalise($group->name); |
|
| 69 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 71 | 71 | ->where('group_id', $group->id) |
| 72 | 72 | ->orderBy('netlogin', 'desc') |
| 73 | 73 | ->get(); |
| 74 | - Storage::disk('export')->put($filename, ''); |
|
| 75 | - $count = count($accounts); |
|
| 76 | - $bar = $this->output->createProgressBar($count); |
|
| 77 | - foreach ($accounts as $account) { |
|
| 78 | - Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | - $bar->advance(); |
|
| 80 | - } |
|
| 81 | - $bar->finish(); |
|
| 82 | - $url = Storage::disk('export')->path($filename); |
|
| 83 | - $this->info("\n{$count} accounts '{$group->name}' exported into file '{$url}'"); |
|
| 84 | - } |
|
| 85 | - } |
|
| 74 | + Storage::disk('export')->put($filename, ''); |
|
| 75 | + $count = count($accounts); |
|
| 76 | + $bar = $this->output->createProgressBar($count); |
|
| 77 | + foreach ($accounts as $account) { |
|
| 78 | + Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | + $bar->advance(); |
|
| 80 | + } |
|
| 81 | + $bar->finish(); |
|
| 82 | + $url = Storage::disk('export')->path($filename); |
|
| 83 | + $this->info("\n{$count} accounts '{$group->name}' exported into file '{$url}'"); |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | 86 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - foreach ($groups as $group){ |
|
| 67 | + foreach ($groups as $group) { |
|
| 68 | 68 | $name = static::stringNormalise($group->name); |
| 69 | 69 | $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
| 70 | 70 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |