Passed
Push — master ( effb68...10dcbb )
by Ferry
03:21
created
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/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.
src/helpers/Module.php 2 patches
Braces   +37 added lines, -22 removed lines patch added patch discarded remove patch
@@ -76,45 +76,60 @@  discard block
 block discarded – undo
76 76
 
77 77
     public function canBrowse() {
78 78
         if($this->privilege) {
79
-            if($this->privilege->can_browse) return true;
80
-            else return false;
81
-        }else{
79
+            if($this->privilege->can_browse) {
80
+                return true;
81
+            } else {
82
+                return false;
83
+            }
84
+        } else{
82 85
             return true;
83 86
         }
84 87
     }
85 88
 
86 89
     public function canCreate() {
87 90
         if($this->privilege) {
88
-            if($this->privilege->can_create) return true;
89
-            else return false;
90
-        }else{
91
+            if($this->privilege->can_create) {
92
+                return true;
93
+            } else {
94
+                return false;
95
+            }
96
+        } else{
91 97
             return true;
92 98
         }
93 99
     }
94 100
 
95 101
     public function canRead() {
96 102
         if($this->privilege) {
97
-            if($this->privilege->can_read) return true;
98
-            else return false;
99
-        }else{
103
+            if($this->privilege->can_read) {
104
+                return true;
105
+            } else {
106
+                return false;
107
+            }
108
+        } else{
100 109
             return true;
101 110
         }
102 111
     }
103 112
 
104 113
     public function canUpdate() {
105 114
         if($this->privilege) {
106
-            if($this->privilege->can_update) return true;
107
-            else return false;
108
-        }else{
115
+            if($this->privilege->can_update) {
116
+                return true;
117
+            } else {
118
+                return false;
119
+            }
120
+        } else{
109 121
             return true;
110 122
         }
111 123
     }
112 124
 
113 125
     public function canDelete() {
114 126
         if($this->privilege) {
115
-            if($this->privilege->can_delete) return true;
116
-            else return false;
117
-        }else{
127
+            if($this->privilege->can_delete) {
128
+                return true;
129
+            } else {
130
+                return false;
131
+            }
132
+        } else{
118 133
             return true;
119 134
         }
120 135
     }
@@ -123,7 +138,7 @@  discard block
 block discarded – undo
123 138
     {
124 139
         if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
125 140
             return action($this->controller.'@getAdd');
126
-        }else{
141
+        } else{
127 142
             return null;
128 143
         }
129 144
     }
@@ -132,7 +147,7 @@  discard block
 block discarded – undo
132 147
     {
133 148
         if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
134 149
             return action($this->controller.'@postAddSave');
135
-        }else{
150
+        } else{
136 151
             return null;
137 152
         }
138 153
     }
@@ -141,7 +156,7 @@  discard block
 block discarded – undo
141 156
     {
142 157
         if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
143 158
             return action($this->controller.'@getEdit',['id'=>$id]);
144
-        }else{
159
+        } else{
145 160
             return null;
146 161
         }
147 162
     }
@@ -150,7 +165,7 @@  discard block
 block discarded – undo
150 165
     {
151 166
         if(method_exists($this->controller_class, 'postEditSave')) {
152 167
             return action($this->controller.'@postEditSave',['id'=>$id]);
153
-        }else{
168
+        } else{
154 169
             return null;
155 170
         }
156 171
     }
@@ -159,7 +174,7 @@  discard block
 block discarded – undo
159 174
     {
160 175
         if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
161 176
             return action($this->controller.'@getDetail',['id'=>$id]);
162
-        }else{
177
+        } else{
163 178
             return null;
164 179
         }
165 180
     }
@@ -168,7 +183,7 @@  discard block
 block discarded – undo
168 183
     {
169 184
         if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
170 185
             return action($this->controller.'@getDelete',['id'=>$id]);
171
-        }else{
186
+        } else{
172 187
             return null;
173 188
         }
174 189
     }
@@ -177,7 +192,7 @@  discard block
 block discarded – undo
177 192
     {
178 193
         if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
179 194
             return trim(action($this->controller.'@getIndex').'/'.$path,'/');
180
-        }else{
195
+        } else{
181 196
             return null;
182 197
         }
183 198
     }
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $routeArray = request()->route()->getAction();
27 27
         $this->controller = class_basename($routeArray['controller']);
28
-        $this->controller = strtok($this->controller,"@");
28
+        $this->controller = strtok($this->controller, "@");
29 29
 
30 30
         $className = "\\".$routeArray["namespace"]."\\".$this->controller;
31
-        if(class_exists($className)) {
32
-            $this->module = cb()->find("cb_modules",["controller"=>$this->controller]);
33
-            if($this->module) {
31
+        if (class_exists($className)) {
32
+            $this->module = cb()->find("cb_modules", ["controller"=>$this->controller]);
33
+            if ($this->module) {
34 34
                 $this->controller_class = new $className();
35
-                $this->menu = cb()->find("cb_menus",["cb_modules_id"=>$this->module->id]);
36
-                $this->menu = (!$this->menu)?cb()->find("cb_menus",["type"=>"path","path"=>request()->segment(2)]):$this->menu;
37
-                if($this->menu) {
35
+                $this->menu = cb()->find("cb_menus", ["cb_modules_id"=>$this->module->id]);
36
+                $this->menu = (!$this->menu) ?cb()->find("cb_menus", ["type"=>"path", "path"=>request()->segment(2)]) : $this->menu;
37
+                if ($this->menu) {
38 38
                     $this->privilege = DB::table("cb_role_privileges")
39 39
                         ->where("cb_menus_id", $this->menu->id)
40 40
                         ->where("cb_roles_id", cb()->session()->roleId())
@@ -53,135 +53,135 @@  discard block
 block discarded – undo
53 53
     }
54 54
 
55 55
     public function getData($key) {
56
-        return ($this->controller_class)?$this->controller_class->getData($key)?:cb()->getAppName():null;
56
+        return ($this->controller_class) ? $this->controller_class->getData($key) ?: cb()->getAppName() : null;
57 57
     }
58 58
 
59 59
     /**
60 60
      * @return CBController
61 61
      */
62 62
     public function getController() {
63
-        return ($this->controller_class)?$this->controller_class:null;
63
+        return ($this->controller_class) ? $this->controller_class : null;
64 64
     }
65 65
 
66 66
     public function getPageTitle()
67 67
     {
68
-        return ($this->controller_class)?$this->controller_class->getData("page_title")?:cb()->getAppName():null;
68
+        return ($this->controller_class) ? $this->controller_class->getData("page_title") ?: cb()->getAppName() : null;
69 69
     }
70 70
 
71 71
     public function getTable()
72 72
     {
73
-        return ($this->controller_class)?$this->controller_class->getData("table"):null;
73
+        return ($this->controller_class) ? $this->controller_class->getData("table") : null;
74 74
     }
75 75
 
76 76
     public function getPageIcon()
77 77
     {
78
-        return ($this->controller_class)?$this->controller_class->getData('page_icon')?:"fa fa-bars":null;
78
+        return ($this->controller_class) ? $this->controller_class->getData('page_icon') ?: "fa fa-bars" : null;
79 79
     }
80 80
 
81 81
     public function canBrowse() {
82
-        if($this->privilege) {
83
-            if($this->privilege->can_browse) return true;
82
+        if ($this->privilege) {
83
+            if ($this->privilege->can_browse) return true;
84 84
             else return false;
85
-        }else{
85
+        } else {
86 86
             return true;
87 87
         }
88 88
     }
89 89
 
90 90
     public function canCreate() {
91
-        if($this->privilege) {
92
-            if($this->privilege->can_create) return true;
91
+        if ($this->privilege) {
92
+            if ($this->privilege->can_create) return true;
93 93
             else return false;
94
-        }else{
94
+        } else {
95 95
             return true;
96 96
         }
97 97
     }
98 98
 
99 99
     public function canRead() {
100
-        if($this->privilege) {
101
-            if($this->privilege->can_read) return true;
100
+        if ($this->privilege) {
101
+            if ($this->privilege->can_read) return true;
102 102
             else return false;
103
-        }else{
103
+        } else {
104 104
             return true;
105 105
         }
106 106
     }
107 107
 
108 108
     public function canUpdate() {
109
-        if($this->privilege) {
110
-            if($this->privilege->can_update) return true;
109
+        if ($this->privilege) {
110
+            if ($this->privilege->can_update) return true;
111 111
             else return false;
112
-        }else{
112
+        } else {
113 113
             return true;
114 114
         }
115 115
     }
116 116
 
117 117
     public function canDelete() {
118
-        if($this->privilege) {
119
-            if($this->privilege->can_delete) return true;
118
+        if ($this->privilege) {
119
+            if ($this->privilege->can_delete) return true;
120 120
             else return false;
121
-        }else{
121
+        } else {
122 122
             return true;
123 123
         }
124 124
     }
125 125
 
126 126
     public function addURL()
127 127
     {
128
-        if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
128
+        if ($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
129 129
             return action($this->controller.'@getAdd');
130
-        }else{
130
+        } else {
131 131
             return null;
132 132
         }
133 133
     }
134 134
 
135 135
     public function addSaveURL()
136 136
     {
137
-        if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
137
+        if ($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
138 138
             return action($this->controller.'@postAddSave');
139
-        }else{
139
+        } else {
140 140
             return null;
141 141
         }
142 142
     }
143 143
 
144 144
     public function editURL($id = null)
145 145
     {
146
-        if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
147
-            return action($this->controller.'@getEdit',['id'=>$id]);
148
-        }else{
146
+        if ($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
147
+            return action($this->controller.'@getEdit', ['id'=>$id]);
148
+        } else {
149 149
             return null;
150 150
         }
151 151
     }
152 152
 
153 153
     public function editSaveURL($id = null)
154 154
     {
155
-        if(method_exists($this->controller_class, 'postEditSave')) {
156
-            return action($this->controller.'@postEditSave',['id'=>$id]);
157
-        }else{
155
+        if (method_exists($this->controller_class, 'postEditSave')) {
156
+            return action($this->controller.'@postEditSave', ['id'=>$id]);
157
+        } else {
158 158
             return null;
159 159
         }
160 160
     }
161 161
 
162
-    public function detailURL($id=null)
162
+    public function detailURL($id = null)
163 163
     {
164
-        if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
165
-            return action($this->controller.'@getDetail',['id'=>$id]);
166
-        }else{
164
+        if ($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
165
+            return action($this->controller.'@getDetail', ['id'=>$id]);
166
+        } else {
167 167
             return null;
168 168
         }
169 169
     }
170 170
 
171
-    public function deleteURL($id=null)
171
+    public function deleteURL($id = null)
172 172
     {
173
-        if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
174
-            return action($this->controller.'@getDelete',['id'=>$id]);
175
-        }else{
173
+        if ($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
174
+            return action($this->controller.'@getDelete', ['id'=>$id]);
175
+        } else {
176 176
             return null;
177 177
         }
178 178
     }
179 179
 
180 180
     public function url($path = null)
181 181
     {
182
-        if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
183
-            return trim(action($this->controller.'@getIndex').'/'.$path,'/');
184
-        }else{
182
+        if ($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
183
+            return trim(action($this->controller.'@getIndex').'/'.$path, '/');
184
+        } else {
185 185
             return null;
186 186
         }
187 187
     }
Please login to merge, or discard this patch.
src/types/datetime/Hook.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
      */
21 21
     public function indexRender($row, $column)
22 22
     {
23
-        if($column->getFormat()) {
23
+        if ($column->getFormat()) {
24 24
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
25
-        }else{
25
+        } else {
26 26
             return $row->{$column->getField()};
27 27
         }
28 28
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         if($column->getFormat()) {
24 24
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
25
-        }else{
25
+        } else{
26 26
             return $row->{$column->getField()};
27 27
         }
28 28
     }
Please login to merge, or discard this patch.
src/types/radio/Radio.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function optionsFromTable($table, $key_field, $display_field, $SQLCondition = null) {
36 36
         $data = DB::table($table);
37
-        if($SQLCondition && is_callable($SQLCondition)) {
37
+        if ($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39 39
         }elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $data = $data->get();
43 43
         $options = [];
44 44
         foreach ($data as $d) {
45
-            $options[ $d->$key_field ] = $d->$display_field;
45
+            $options[$d->$key_field] = $d->$display_field;
46 46
         }
47 47
         $this->options($options);
48 48
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $data = DB::table($table);
37 37
         if($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39
-        }elseif ($SQLCondition && is_string($SQLCondition)) {
39
+        } elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
41 41
         }
42 42
         $data = $data->get();
Please login to merge, or discard this patch.
src/types/select/Hook.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function query($query, $column)
21 21
     {
22
-        if($column->getOptionsFromTable()) {
22
+        if ($column->getOptionsFromTable()) {
23 23
             $option = $column->getOptionsFromTable();
24
-            $query->join($option["table"],$option["table"].'.'.$option["key_field"],"=", $column->getName());
24
+            $query->join($option["table"], $option["table"].'.'.$option["key_field"], "=", $column->getName());
25 25
             $query->addSelect($option['table'].'.'.$option['display_field'].' as '.$option['table'].'_'.$option['display_field']);
26 26
         }
27 27
         return $query;
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function indexRender($row, $column)
35 35
     {
36
-        if($column->getOptionsFromTable()) {
36
+        if ($column->getOptionsFromTable()) {
37 37
             $option = $column->getOptionsFromTable();
38 38
             return $row->{ $option['table'].'_'.$option['display_field'] };
39
-        }else{
39
+        } else {
40 40
             $option = $column->getOptions();
41 41
             $key = $row->{ $column->getField() };
42
-            return @$option[ $key ];
42
+            return @$option[$key];
43 43
         }
44 44
     }
45 45
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         if($column->getOptionsFromTable()) {
37 37
             $option = $column->getOptionsFromTable();
38 38
             return $row->{ $option['table'].'_'.$option['display_field'] };
39
-        }else{
39
+        } else{
40 40
             $option = $column->getOptions();
41 41
             $key = $row->{ $column->getField() };
42 42
             return @$option[ $key ];
Please login to merge, or discard this patch.
src/database/migrations/2016_08_07_152421_table_menus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('cb_menus', function (Blueprint $table) {
15
+        Schema::create('cb_menus', function(Blueprint $table) {
16 16
             $table->increments("id");
17 17
             $table->string('name');
18 18
             $table->string("icon")->nullable();
Please login to merge, or discard this patch.