Completed
Push — develop ( 9c74c1...033e04 )
by Greg
01:53
created
app/Console/Commands/ExportCategories.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -55,32 +55,32 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
app/Console/Commands/ExportGroups.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -55,32 +55,32 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     /**
62 62
      * Handle an authentication attempt.
63 63
      *
64
-     * @return Response
64
+     * @return \Illuminate\Http\RedirectResponse|null
65 65
      */
66 66
     public function authenticate(Request $request)
67 67
     {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,10 +68,10 @@
 block discarded – undo
68 68
         $credentials = $request->only('email', 'password');
69 69
 
70 70
         if (Auth::attempt([
71
-          'email' => $credentials['email'],
72
-          'password' => $credentials['password'],
73
-          'status' => App\User::USER_ENABLED
74
-          ])) {
71
+            'email' => $credentials['email'],
72
+            'password' => $credentials['password'],
73
+            'status' => App\User::USER_ENABLED
74
+            ])) {
75 75
             // Authentication passed...
76 76
             return redirect()->intended('home');
77 77
         }
Please login to merge, or discard this patch.
app/User.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,27 +15,27 @@
 block discarded – undo
15 15
     const USER_ENABLED = 1;
16 16
 
17 17
     const USER_STATUS = [
18
-        0 => [  'text' => 'users.disabled',
18
+        0 => ['text' => 'users.disabled',
19 19
                 'icon' => '',
20
-                'unicon' => '' ],
21
-        1 => [  'text' => 'users.enabled',
20
+                'unicon' => ''],
21
+        1 => ['text' => 'users.enabled',
22 22
                 'icon' => 'fa-check',
23
-                'unicon' => '' ]
23
+                'unicon' => '']
24 24
     ];
25 25
 
26 26
     const USER_LEVEL = [
27
-        1 => [  'text' => 'users.access.local',
27
+        1 => ['text' => 'users.access.local',
28 28
                 'icon' => 'fa-support',
29
-                'unicon' => '' ],
30
-        3 => [  'text' => 'users.access.global',
29
+                'unicon' => ''],
30
+        3 => ['text' => 'users.access.global',
31 31
                 'icon' => 'fa-globe',
32
-                'unicon' => '' ],
33
-        5 => [  'text' => 'users.access.admin',
32
+                'unicon' => ''],
33
+        5 => ['text' => 'users.access.admin',
34 34
                 'icon' => 'fa-shield',
35
-                'unicon' => '' ],
36
-        9 => [  'text' => 'users.access.super',
35
+                'unicon' => ''],
36
+        9 => ['text' => 'users.access.super',
37 37
                 'icon' => 'fa-rocket',
38
-                'unicon' => '' ],
38
+                'unicon' => ''],
39 39
     ];
40 40
 
41 41
     const SEARCH_CRITERIA = [
Please login to merge, or discard this patch.
app/Http/Controllers/GroupController.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-
7
-use App\Http\Requests;
8 6
 use App\Group;
9 7
 use App\Account;
10 8
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
     {
102 102
         $group = Group::findOrFail($id);
103 103
         $accounts = Group::Find($id)->accounts()->where('status', Account::ACCOUNT_DISABLE);
104
-        if (count($accounts) > 0 ) {
104
+        if (count($accounts) > 0) {
105 105
             $accounts->delete();
106 106
         }
107 107
         return redirect()->back()->with(
Please login to merge, or discard this patch.