Passed
Push — master ( 36593d...81fba8 )
by Ferry
05:32 queued 02:06
created
src/views/module/form/form_body.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 @endforeach
11 11
 
12 12
 <?php
13
-    if(cb()->getCurrentMethod()=="getEdit") {
13
+    if (cb()->getCurrentMethod() == "getEdit") {
14 14
         /** @var $row object */
15 15
         columnSingleton()->valueAssignment($row);
16 16
     }
Please login to merge, or discard this patch.
src/controllers/DeveloperUsersController.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
     public function getIndex() {
28 28
         $data = [];
29 29
         $data['result'] = DB::table("users")
30
-            ->join("cb_roles","cb_roles.id","=","cb_roles_id")
31
-            ->select("users.*","cb_roles.name as cb_roles_name")
30
+            ->join("cb_roles", "cb_roles.id", "=", "cb_roles_id")
31
+            ->select("users.*", "cb_roles.name as cb_roles_name")
32 32
             ->get();
33
-        return view($this->view.'.index',$data);
33
+        return view($this->view.'.index', $data);
34 34
     }
35 35
 
36 36
     public function getAdd() {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function postAddSave() {
43 43
         try {
44
-            cb()->validation(['name', 'email','password','cb_roles_id']);
44
+            cb()->validation(['name', 'email', 'password', 'cb_roles_id']);
45 45
 
46 46
             $user = [];
47 47
             $user['name'] = request('name');
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $user['cb_roles_id'] = request('cb_roles_id');
51 51
             DB::table('users')->insert($user);
52 52
 
53
-            return cb()->redirect(route("DeveloperUsersControllerGetIndex"),"New user has been created!","success");
53
+            return cb()->redirect(route("DeveloperUsersControllerGetIndex"), "New user has been created!", "success");
54 54
 
55 55
         } catch (CBValidationException $e) {
56 56
             return cb()->redirectBack($e->getMessage());
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function postEditSave($id) {
68 68
         try {
69
-            cb()->validation(['name', 'email','cb_roles_id']);
69
+            cb()->validation(['name', 'email', 'cb_roles_id']);
70 70
 
71 71
             $user = [];
72 72
             $user['name'] = request('name');
73 73
             $user['email'] = request('email');
74
-            if(request('password')) $user['password'] = Hash::make(request('password'));
74
+            if (request('password')) $user['password'] = Hash::make(request('password'));
75 75
             $user['cb_roles_id'] = request('cb_roles_id');
76
-            DB::table('users')->where('id',$id)->update($user);
76
+            DB::table('users')->where('id', $id)->update($user);
77 77
 
78
-            return cb()->redirect(route("DeveloperUsersControllerGetIndex"),"The user has been updated!","success");
78
+            return cb()->redirect(route("DeveloperUsersControllerGetIndex"), "The user has been updated!", "success");
79 79
 
80 80
         } catch (CBValidationException $e) {
81 81
             return cb()->redirectBack($e->getMessage());
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     public function getDelete($id) {
86
-        DB::table("users")->where("id",$id)->delete();
87
-        return cb()->redirectBack("The user has been deleted!","success");
86
+        DB::table("users")->where("id", $id)->delete();
87
+        return cb()->redirectBack("The user has been deleted!", "success");
88 88
     }
89 89
 
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@
 block discarded – undo
71 71
             $user = [];
72 72
             $user['name'] = request('name');
73 73
             $user['email'] = request('email');
74
-            if(request('password')) $user['password'] = Hash::make(request('password'));
74
+            if(request('password')) {
75
+                $user['password'] = Hash::make(request('password'));
76
+            }
75 77
             $user['cb_roles_id'] = request('cb_roles_id');
76 78
             DB::table('users')->where('id',$id)->update($user);
77 79
 
Please login to merge, or discard this patch.
src/controllers/DeveloperMenusController.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -24,22 +24,22 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function getIndex() {
26 26
         $data = [];
27
-        return view($this->view.".index",$data);
27
+        return view($this->view.".index", $data);
28 28
     }
29 29
 
30 30
     public function getAdd() {
31 31
         $data = [];
32 32
         $data['form_title'] = "Add Menu";
33 33
         $data['form_url'] = route('DeveloperMenusControllerPostAddSave');
34
-        $data['modules'] = DB::table("cb_modules")->orderBy("name","asc")->get();
34
+        $data['modules'] = DB::table("cb_modules")->orderBy("name", "asc")->get();
35 35
         return view($this->view.".form", $data);
36 36
     }
37 37
 
38 38
     public function getEdit($id) {
39 39
         $data = [];
40 40
         $data['form_title'] = "Edit Menu";
41
-        $data['form_url'] = route('DeveloperMenusControllerPostEditSave',['id'=>$id]);
42
-        $data['modules'] = DB::table("cb_modules")->orderBy("name","asc")->get();
41
+        $data['form_url'] = route('DeveloperMenusControllerPostEditSave', ['id'=>$id]);
42
+        $data['modules'] = DB::table("cb_modules")->orderBy("name", "asc")->get();
43 43
         $data['row'] = cb()->find("cb_menus", $id);
44 44
         return view($this->view.".form", $data);
45 45
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $menu['name'] = request('name');
53 53
             $menu['icon'] = request('icon');
54 54
             $menu['type'] = request('type');
55
-            if(request('type') == 'module') {
55
+            if (request('type') == 'module') {
56 56
                 $menu['cb_modules_id'] = request('cb_modules_id');
57 57
             }elseif (request('type') == 'url') {
58 58
                 $menu['path'] = request('url_value');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
             DB::table("cb_menus")->insert($menu);
64 64
 
65
-            return cb()->redirect(route("DeveloperMenusControllerGetIndex"),"The menu has been added!","success");
65
+            return cb()->redirect(route("DeveloperMenusControllerGetIndex"), "The menu has been added!", "success");
66 66
 
67 67
         } catch (CBValidationException $e) {
68 68
             return cb()->redirectBack($e->getMessage());
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
             $menu['name'] = request('name');
78 78
             $menu['icon'] = request('icon');
79 79
             $menu['type'] = request('type');
80
-            if(request('type') == 'module') {
80
+            if (request('type') == 'module') {
81 81
                 $menu['cb_modules_id'] = request('cb_modules_id');
82 82
             }elseif (request('type') == 'url') {
83 83
                 $menu['path'] = request('url_value');
84 84
             }elseif (request('type') == 'path') {
85 85
                 $menu['path'] = request('path_value');
86 86
             }
87
-            DB::table("cb_menus")->where("id",$id)->update($menu);
87
+            DB::table("cb_menus")->where("id", $id)->update($menu);
88 88
 
89
-            return cb()->redirect(route("DeveloperMenusControllerGetIndex"),"The menu has been saved!","success");
89
+            return cb()->redirect(route("DeveloperMenusControllerGetIndex"), "The menu has been saved!", "success");
90 90
 
91 91
         } catch (CBValidationException $e) {
92 92
             return cb()->redirectBack($e->getMessage());
@@ -99,20 +99,20 @@  discard block
 block discarded – undo
99 99
 
100 100
             $menus = request('menus');
101 101
             $menus = json_decode($menus, true);
102
-            if($menus) {
102
+            if ($menus) {
103 103
                 $menus = $menus[0];
104
-                if($menus) {
105
-                    foreach($menus as $i=>$menu) {
104
+                if ($menus) {
105
+                    foreach ($menus as $i=>$menu) {
106 106
                         $id = $menu['id'];
107
-                        cb()->update("cb_menus",$id,["sort_number"=>$i]);
108
-                        if($menu['children'][0]) {
109
-                            foreach($menu['children'][0] as $ii=>$sub) {
107
+                        cb()->update("cb_menus", $id, ["sort_number"=>$i]);
108
+                        if ($menu['children'][0]) {
109
+                            foreach ($menu['children'][0] as $ii=>$sub) {
110 110
                                 $id = $sub['id'];
111
-                                cb()->update("cb_menus",$id,["sort_number"=>$ii,"parent_cb_menus_id"=>$menu['id']]);
112
-                                if($sub['children'][0]) {
113
-                                    foreach($sub['children'][0] as $iii=>$subsub) {
111
+                                cb()->update("cb_menus", $id, ["sort_number"=>$ii, "parent_cb_menus_id"=>$menu['id']]);
112
+                                if ($sub['children'][0]) {
113
+                                    foreach ($sub['children'][0] as $iii=>$subsub) {
114 114
                                         $id = $subsub['id'];
115
-                                        cb()->update("cb_menus",$id,["sort_number"=>$iii,"parent_cb_menus_id"=>$sub['id']]);
115
+                                        cb()->update("cb_menus", $id, ["sort_number"=>$iii, "parent_cb_menus_id"=>$sub['id']]);
116 116
                                     }
117 117
                                 }
118 118
                             }
@@ -121,17 +121,17 @@  discard block
 block discarded – undo
121 121
                 }
122 122
             }
123 123
 
124
-            return response()->json(['api_status'=>1,'api_message'=>'success']);
124
+            return response()->json(['api_status'=>1, 'api_message'=>'success']);
125 125
 
126 126
         } catch (CBValidationException $e) {
127
-            return response()->json(['api_status'=>0,'api_message'=>$e->getMessage()]);
127
+            return response()->json(['api_status'=>0, 'api_message'=>$e->getMessage()]);
128 128
         }
129 129
     }
130 130
 
131 131
     public function getDelete($id) {
132
-        DB::table("cb_menus")->where("id",$id)->delete();
132
+        DB::table("cb_menus")->where("id", $id)->delete();
133 133
 
134
-        return cb()->redirectBack("The menu has been deleted!","success");
134
+        return cb()->redirectBack("The menu has been deleted!", "success");
135 135
     }
136 136
 
137 137
 }
138 138
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
             $menu['type'] = request('type');
55 55
             if(request('type') == 'module') {
56 56
                 $menu['cb_modules_id'] = request('cb_modules_id');
57
-            }elseif (request('type') == 'url') {
57
+            } elseif (request('type') == 'url') {
58 58
                 $menu['path'] = request('url_value');
59
-            }elseif (request('type') == 'path') {
59
+            } elseif (request('type') == 'path') {
60 60
                 $menu['path'] = request('path_value');
61 61
             }
62 62
 
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
             $menu['type'] = request('type');
80 80
             if(request('type') == 'module') {
81 81
                 $menu['cb_modules_id'] = request('cb_modules_id');
82
-            }elseif (request('type') == 'url') {
82
+            } elseif (request('type') == 'url') {
83 83
                 $menu['path'] = request('url_value');
84
-            }elseif (request('type') == 'path') {
84
+            } elseif (request('type') == 'path') {
85 85
                 $menu['path'] = request('path_value');
86 86
             }
87 87
             DB::table("cb_menus")->where("id",$id)->update($menu);
Please login to merge, or discard this patch.
src/controllers/scaffolding/traits/ColumnsRegister.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
         $data = new TextModel();
54 54
         $data = $this->setDefaultModelValue($data);
55 55
         $data->setLabel($label);
56
-        $data->setName($this->name($label,$name));
57
-        $data->setField($field_to_save?:$this->name($label, $name));
56
+        $data->setName($this->name($label, $name));
57
+        $data->setField($field_to_save ?: $this->name($label, $name));
58 58
         $data->setType("text");
59 59
 
60 60
         columnSingleton()->setColumn($this->index, $data);
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
         $data = new CheckboxModel();
70 70
         $data = $this->setDefaultModelValue($data);
71 71
         $data->setLabel($label);
72
-        $data->setName($this->name($label,$name));
73
-        $data->setField($field_to_save?:$this->name($label, $name));
72
+        $data->setName($this->name($label, $name));
73
+        $data->setField($field_to_save ?: $this->name($label, $name));
74 74
         $data->setType("checkbox");
75 75
 
76 76
         columnSingleton()->setColumn($this->index, $data);
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         $data = new PasswordModel();
86 86
         $data = $this->setDefaultModelValue($data);
87 87
         $data->setLabel($label);
88
-        $data->setName($this->name($label,$name));
89
-        $data->setField($field_to_save?:$this->name($label, $name));
88
+        $data->setName($this->name($label, $name));
89
+        $data->setField($field_to_save ?: $this->name($label, $name));
90 90
         $data->setType("password");
91 91
         $data->setShowDetail(false);
92 92
         $data->setShowIndex(false);
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
         $data = new ImageModel();
104 104
         $data = $this->setDefaultModelValue($data);
105 105
         $data->setLabel($label);
106
-        $data->setName($this->name($label,$name));
107
-        $data->setField($field_to_save?:$this->name($label, $name));
106
+        $data->setName($this->name($label, $name));
107
+        $data->setField($field_to_save ?: $this->name($label, $name));
108 108
         $data->setType("image");
109 109
 
110 110
         columnSingleton()->setColumn($this->index, $data);
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
         $data = new TextAreaModel();
120 120
         $data = $this->setDefaultModelValue($data);
121 121
         $data->setLabel($label);
122
-        $data->setName($this->name($label,$name));
123
-        $data->setField($field_to_save?:$this->name($label, $name));
122
+        $data->setName($this->name($label, $name));
123
+        $data->setField($field_to_save ?: $this->name($label, $name));
124 124
         $data->setType("text_area");
125 125
 
126 126
         columnSingleton()->setColumn($this->index, $data);
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
         $data = new SelectModel();
136 136
         $data = $this->setDefaultModelValue($data);
137 137
         $data->setLabel($label);
138
-        $data->setName($this->name($label,$name));
139
-        $data->setField($field_to_save?:$this->name($label, $name));
138
+        $data->setName($this->name($label, $name));
139
+        $data->setField($field_to_save ?: $this->name($label, $name));
140 140
         $data->setType("select");
141 141
 
142 142
         columnSingleton()->setColumn($this->index, $data);
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
         $data = new CustomModel();
153 153
         $data = $this->setDefaultModelValue($data);
154 154
         $data->setLabel($label);
155
-        $data->setName($this->name($label,$name));
156
-        $data->setField($field_to_save?:$this->name($label, $name));
155
+        $data->setName($this->name($label, $name));
156
+        $data->setField($field_to_save ?: $this->name($label, $name));
157 157
         $data->setType("custom");
158 158
 
159 159
         columnSingleton()->setColumn($this->index, $data);
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
         $data = new DateModel();
169 169
         $data = $this->setDefaultModelValue($data);
170 170
         $data->setLabel($label);
171
-        $data->setName($this->name($label,$name));
172
-        $data->setField($field_to_save?:$this->name($label, $name));
171
+        $data->setName($this->name($label, $name));
172
+        $data->setField($field_to_save ?: $this->name($label, $name));
173 173
         $data->setType("date");
174 174
 
175 175
         columnSingleton()->setColumn($this->index, $data);
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
         $data = new DatetimeModel();
185 185
         $data = $this->setDefaultModelValue($data);
186 186
         $data->setLabel($label);
187
-        $data->setName($this->name($label,$name));
188
-        $data->setField($field_to_save?:$this->name($label, $name));
187
+        $data->setName($this->name($label, $name));
188
+        $data->setField($field_to_save ?: $this->name($label, $name));
189 189
         $data->setType("datetime");
190 190
 
191 191
         columnSingleton()->setColumn($this->index, $data);
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
         $data = new EmailModel();
201 201
         $data = $this->setDefaultModelValue($data);
202 202
         $data->setLabel($label);
203
-        $data->setName($this->name($label,$name));
204
-        $data->setField($field_to_save?:$this->name($label, $name));
203
+        $data->setName($this->name($label, $name));
204
+        $data->setField($field_to_save ?: $this->name($label, $name));
205 205
         $data->setType("email");
206 206
 
207 207
         columnSingleton()->setColumn($this->index, $data);
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
         $data = new FileModel();
217 217
         $data = $this->setDefaultModelValue($data);
218 218
         $data->setLabel($label);
219
-        $data->setName($this->name($label,$name));
220
-        $data->setField($field_to_save?:$this->name($label, $name));
219
+        $data->setName($this->name($label, $name));
220
+        $data->setField($field_to_save ?: $this->name($label, $name));
221 221
         $data->setType("file");
222 222
 
223 223
         columnSingleton()->setColumn($this->index, $data);
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
         $data = new HiddenModel();
234 234
         $data = $this->setDefaultModelValue($data);
235 235
         $data->setLabel($label);
236
-        $data->setName($this->name($label,$name));
237
-        $data->setField($field_to_save?:$this->name($label, $name));
236
+        $data->setName($this->name($label, $name));
237
+        $data->setField($field_to_save ?: $this->name($label, $name));
238 238
         $data->setType("hidden");
239 239
 
240 240
         columnSingleton()->setColumn($this->index, $data);
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
         $data = new NumberModel();
250 250
         $data = $this->setDefaultModelValue($data);
251 251
         $data->setLabel($label);
252
-        $data->setName($this->name($label,$name));
253
-        $data->setField($field_to_save?:$this->name($label, $name));
252
+        $data->setName($this->name($label, $name));
253
+        $data->setField($field_to_save ?: $this->name($label, $name));
254 254
         $data->setType("number");
255 255
 
256 256
         columnSingleton()->setColumn($this->index, $data);
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
         $data = new RadioModel();
266 266
         $data = $this->setDefaultModelValue($data);
267 267
         $data->setLabel($label);
268
-        $data->setName($this->name($label,$name));
269
-        $data->setField($field_to_save?:$this->name($label, $name));
268
+        $data->setName($this->name($label, $name));
269
+        $data->setField($field_to_save ?: $this->name($label, $name));
270 270
         $data->setType("radio");
271 271
 
272 272
         columnSingleton()->setColumn($this->index, $data);
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
         $data = new WysiwygModel();
282 282
         $data = $this->setDefaultModelValue($data);
283 283
         $data->setLabel($label);
284
-        $data->setName($this->name($label,$name));
285
-        $data->setField($field_to_save?:$this->name($label, $name));
284
+        $data->setName($this->name($label, $name));
285
+        $data->setField($field_to_save ?: $this->name($label, $name));
286 286
         $data->setType("wysiwyg");
287 287
 
288 288
         columnSingleton()->setColumn($this->index, $data);
Please login to merge, or discard this patch.
src/controllers/scaffolding/traits/ColumnsBasic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
     private function name($label, $name = null)
20 20
     {
21
-        return (!$name)?strtolower(slug($label,"_")):$name;
21
+        return (!$name) ?strtolower(slug($label, "_")) : $name;
22 22
     }
23 23
 
24 24
     /**
Please login to merge, or discard this patch.
src/controllers/scaffolding/singletons/ColumnSingleton.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
     public function valueAssignment($data_row = null) {
43 43
         foreach ($this->getColumns() as $index=>$column) {
44 44
             /** @var ColumnModel $column */
45
-            if($data_row) {
45
+            if ($data_row) {
46 46
                 $value = $data_row->{ $column->getField() };
47
-            }else{
47
+            } else {
48 48
                 $value = request($column->getName());
49 49
             }
50 50
 
51
-            if (! $column->getName()) {
51
+            if (!$column->getName()) {
52 52
                 continue;
53 53
             }
54 54
 
55
-            if(!$value && $column->getDefaultValue()) {
55
+            if (!$value && $column->getDefaultValue()) {
56 56
                 $value = $column->getDefaultValue();
57 57
             }
58 58
 
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
     public function getIndexColumns()
68 68
     {
69 69
         $data = $this->columns;
70
-        foreach($data as $i=>$item) {
70
+        foreach ($data as $i=>$item) {
71 71
             /** @var ColumnModel $item */
72
-            if($item->getShowIndex() === false) {
72
+            if ($item->getShowIndex() === false) {
73 73
                 unset($data[$i]);
74 74
             }
75 75
         }
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
     public function getAddEditColumns()
80 80
     {
81 81
         $data = $this->columns;
82
-        foreach($data as $i=>$item) {
82
+        foreach ($data as $i=>$item) {
83 83
             /** @var ColumnModel $item */
84
-            if($item->getShowIndex() === false) {
84
+            if ($item->getShowIndex() === false) {
85 85
                 unset($data[$i]);
86 86
             }
87 87
 
88
-            if($item->getShowDetail() === false) {
88
+            if ($item->getShowDetail() === false) {
89 89
                 unset($data[$i]);
90 90
             }
91 91
 
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
     public function getEditColumns()
97 97
     {
98 98
         $data = $this->columns;
99
-        foreach($data as $i=>$item) {
99
+        foreach ($data as $i=>$item) {
100 100
             /** @var ColumnModel $item */
101
-            if($item->getShowEdit() === false) {
101
+            if ($item->getShowEdit() === false) {
102 102
                 unset($data[$i]);
103 103
             }
104 104
         }
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
     public function getAddColumns()
109 109
     {
110 110
         $data = $this->columns;
111
-        foreach($data as $i=>$item) {
111
+        foreach ($data as $i=>$item) {
112 112
             /** @var ColumnModel $item */
113
-            if($item->getShowAdd() === false) {
113
+            if ($item->getShowAdd() === false) {
114 114
                 unset($data[$i]);
115 115
             }
116 116
         }
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
     public function getDetailColumns()
121 121
     {
122 122
         $data = $this->columns;
123
-        foreach($data as $i=>$item) {
123
+        foreach ($data as $i=>$item) {
124 124
             /** @var ColumnModel $item */
125
-            if($item->getShowDetail() === false) {
125
+            if ($item->getShowDetail() === false) {
126 126
                 unset($data[$i]);
127 127
             }
128 128
         }
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
     public function getAssignmentData()
133 133
     {
134 134
         $data = [];
135
-        foreach($this->columns as $column) {
135
+        foreach ($this->columns as $column) {
136 136
             /** @var ColumnModel $column */
137
-            if(is_array($column->getValue())) {
138
-                foreach($column->getValue() as $key=>$val) {
137
+            if (is_array($column->getValue())) {
138
+                foreach ($column->getValue() as $key=>$val) {
139 139
                     $data[$key] = $val;
140 140
                 }
141
-            }else{
141
+            } else {
142 142
                 $data[$column->getField()] = $column->getValue();
143 143
             }
144 144
         }
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
     public function removeColumn($label_or_name)
149 149
     {
150 150
         $data = $this->getColumns();
151
-        foreach($data as $i=>$d)
151
+        foreach ($data as $i=>$d)
152 152
         {
153 153
             /** @var ColumnModel $d */
154
-            if($d->getLabel() == $label_or_name || $d->getName() == $label_or_name) {
154
+            if ($d->getLabel() == $label_or_name || $d->getName() == $label_or_name) {
155 155
                 unset($data[$i]);
156 156
             }
157 157
         }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     public function getColumnNameOnly()
162 162
     {
163 163
         $result = [];
164
-        foreach($this->columns as $column) {
164
+        foreach ($this->columns as $column) {
165 165
             /** @var ColumnModel $column */
166 166
             $result[] = $column->getName();
167 167
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             /** @var ColumnModel $column */
45 45
             if($data_row) {
46 46
                 $value = $data_row->{ $column->getField() };
47
-            }else{
47
+            } else{
48 48
                 $value = request($column->getName());
49 49
             }
50 50
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 foreach($column->getValue() as $key=>$val) {
139 139
                     $data[$key] = $val;
140 140
                 }
141
-            }else{
141
+            } else{
142 142
                 $data[$column->getField()] = $column->getValue();
143 143
             }
144 144
         }
Please login to merge, or discard this patch.
src/controllers/DeveloperDashboardController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     public function getIndex() {
16 16
         $data = [];
17 17
         $data['page_title'] = "Dashboard";
18
-        return view('crudbooster::dev_layouts.modules.dashboard',$data);
18
+        return view('crudbooster::dev_layouts.modules.dashboard', $data);
19 19
     }
20 20
     
21 21
 
Please login to merge, or discard this patch.
src/controllers/DeveloperModulesController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function getIndex() {
27 27
         $data = [];
28 28
         $data['result'] = DB::table("cb_modules")->get();
29
-        return view($this->view.'.index',$data);
29
+        return view($this->view.'.index', $data);
30 30
     }
31 31
 
32 32
     public function getAdd() {
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function postAddSave() {
39 39
         try {
40
-            cb()->validation(['name', 'table','icon']);
40
+            cb()->validation(['name', 'table', 'icon']);
41 41
 
42 42
             (new ModuleGenerator(request('table'), request('name'), request('icon')))->make();
43 43
 
44
-            return cb()->redirect(route("DeveloperModulesControllerGetIndex"),"New module has been created!","success");
44
+            return cb()->redirect(route("DeveloperModulesControllerGetIndex"), "New module has been created!", "success");
45 45
 
46 46
         } catch (CBValidationException $e) {
47 47
             return cb()->redirectBack($e->getMessage());
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
         try {
59 59
             cb()->validation(['name', 'icon']);
60 60
 
61
-            cb()->updateCompact("cb_modules", $id, ['name','icon']);
61
+            cb()->updateCompact("cb_modules", $id, ['name', 'icon']);
62 62
 
63
-            return cb()->redirect(route("DeveloperModulesControllerGetIndex"),"Module has been updated!","success");
63
+            return cb()->redirect(route("DeveloperModulesControllerGetIndex"), "Module has been updated!", "success");
64 64
 
65 65
         } catch (CBValidationException $e) {
66 66
             return cb()->redirectBack($e->getMessage());
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     public function getDelete($id) {
71
-        $module = cb()->find("cb_modules",$id);
71
+        $module = cb()->find("cb_modules", $id);
72 72
         @unlink(app_path("Http/Controllers/".$module->controller));
73 73
         DB::table("cb_modules")->where("id", $id)->delete();
74 74
         DB::table("cb_menus")->where("cb_modules_id", $id)->delete();
75 75
 
76
-        return cb()->redirectBack("The module has been deleted!","success");
76
+        return cb()->redirectBack("The module has been deleted!", "success");
77 77
     }
78 78
 
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
src/controllers/AdminAuthController.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
     public function getLogin()
9 9
     {
10
-        if(!auth()->guest()) return redirect(cb()->getAdminUrl());
10
+        if (!auth()->guest()) return redirect(cb()->getAdminUrl());
11 11
 
12 12
         cbHook()->hookGetLogin();
13 13
 
@@ -16,20 +16,20 @@  discard block
 block discarded – undo
16 16
 
17 17
     public function postLogin()
18 18
     {
19
-        try{
19
+        try {
20 20
             cb()->validation([
21 21
                 'email'=>'required|email',
22 22
                 'password'=>'required'
23 23
             ]);
24
-            $credential = request()->only(['email','password']);
24
+            $credential = request()->only(['email', 'password']);
25 25
             if (auth()->attempt($credential)) {
26 26
                 cbHook()->hookPostLogin();
27 27
                 return redirect(cb()->getAdminUrl());
28 28
             } else {
29
-                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'),'message_type'=>'warning']);
29
+                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'), 'message_type'=>'warning']);
30 30
             }
31
-        }catch (CBValidationException $e) {
32
-            return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning');
31
+        } catch (CBValidationException $e) {
32
+            return cb()->redirect(cb()->getAdminUrl("login"), $e->getMessage(), 'warning');
33 33
         }
34 34
     }
35 35
 
@@ -44,25 +44,25 @@  discard block
 block discarded – undo
44 44
     }
45 45
 
46 46
     public function postLoginDeveloper() {
47
-        try{
47
+        try {
48 48
             cb()->validation([
49 49
                 'username'=>'required',
50 50
                 'password'=>'required'
51 51
             ]);
52 52
 
53
-            if(request('username') == config('crudbooster.DEV_USERNAME')
53
+            if (request('username') == config('crudbooster.DEV_USERNAME')
54 54
                 && request('password') == config('crudbooster.DEV_PASSWORD')) {
55 55
 
56 56
                 session(['developer'=>1]);
57 57
 
58 58
                 return redirect(cb()->getDeveloperUrl());
59 59
 
60
-            }else{
60
+            } else {
61 61
                 return cb()->redirectBack("Username and or password is wrong!");
62 62
             }
63 63
 
64
-        }catch (CBValidationException $e) {
65
-            return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning');
64
+        } catch (CBValidationException $e) {
65
+            return cb()->redirect(cb()->getLoginUrl(), $e->getMessage(), 'warning');
66 66
         }
67 67
     }
68 68
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@  discard block
 block discarded – undo
7 7
 
8 8
     public function getLogin()
9 9
     {
10
-        if(!auth()->guest()) return redirect(cb()->getAdminUrl());
10
+        if(!auth()->guest()) {
11
+            return redirect(cb()->getAdminUrl());
12
+        }
11 13
 
12 14
         cbHook()->hookGetLogin();
13 15
 
@@ -28,7 +30,7 @@  discard block
 block discarded – undo
28 30
             } else {
29 31
                 return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'),'message_type'=>'warning']);
30 32
             }
31
-        }catch (CBValidationException $e) {
33
+        } catch (CBValidationException $e) {
32 34
             return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning');
33 35
         }
34 36
     }
@@ -57,11 +59,11 @@  discard block
 block discarded – undo
57 59
 
58 60
                 return redirect(cb()->getDeveloperUrl());
59 61
 
60
-            }else{
62
+            } else{
61 63
                 return cb()->redirectBack("Username and or password is wrong!");
62 64
             }
63 65
 
64
-        }catch (CBValidationException $e) {
66
+        } catch (CBValidationException $e) {
65 67
             return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning');
66 68
         }
67 69
     }
Please login to merge, or discard this patch.