@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | private function existsPrivilege($cb_roles_id, $cb_menus_id) { |
89 | 89 | if($row = cb()->find("cb_role_privileges",['cb_roles_id'=>$cb_roles_id,'cb_menus_id'=>$cb_menus_id])) { |
90 | 90 | return $row->id; |
91 | - }else{ |
|
91 | + } else{ |
|
92 | 92 | return null; |
93 | 93 | } |
94 | 94 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $privilege["can_delete"] = @$access['can_delete']?:0; |
112 | 112 | if($privilege_id = $this->existsPrivilege($id, $menus_id)) { |
113 | 113 | DB::table("cb_role_privileges")->where("id", $privilege_id)->update($privilege); |
114 | - }else{ |
|
114 | + } else{ |
|
115 | 115 | DB::table("cb_role_privileges")->insert($privilege); |
116 | 116 | } |
117 | 117 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | foreach($data_options as $key=>$option) { |
25 | 25 | if(is_int($key)) { |
26 | 26 | $data_options[$option] = $option; |
27 | - }else{ |
|
27 | + } else{ |
|
28 | 28 | $data_options[$key] = $option; |
29 | 29 | } |
30 | 30 | } |
@@ -36,7 +36,7 @@ |
||
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 ]; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | return response()->json(['status'=>true, 'data'=>$data], 200, ["X-Frame-Options"=>"SAMEORIGIN"]); |
32 | 32 | |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | return response()->json(['status'=>false]); |
35 | 35 | } |
36 | 36 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if(Str::contains(strtolower($item),["title","name","label"])) { |
56 | 56 | $display = true; |
57 | - }else{ |
|
57 | + } else{ |
|
58 | 58 | $display = false; |
59 | 59 | } |
60 | 60 | |
@@ -83,7 +83,9 @@ discard block |
||
83 | 83 | if($column != $pk) { |
84 | 84 | |
85 | 85 | // Skip Column |
86 | - if($column == 'deleted_at') continue; |
|
86 | + if($column == 'deleted_at') { |
|
87 | + continue; |
|
88 | + } |
|
87 | 89 | |
88 | 90 | // Check if any relation table candidate |
89 | 91 | $optionTable = ""; |
@@ -92,7 +94,7 @@ discard block |
||
92 | 94 | if(Schema::hasTable($relationTable)) { |
93 | 95 | $optionTable = $relationTable; |
94 | 96 | } |
95 | - }elseif (Str::substr(strtolower($column),0,3) == "id_") { |
|
97 | + } elseif (Str::substr(strtolower($column),0,3) == "id_") { |
|
96 | 98 | $relationTable = Str::substr($column,3); |
97 | 99 | if(Schema::hasTable($relationTable)) { |
98 | 100 | $optionTable = $relationTable; |
@@ -105,15 +107,15 @@ discard block |
||
105 | 107 | |
106 | 108 | if(Str::contains(strtolower($label),["photo","image","picture","gambar"])) { |
107 | 109 | $type = "image"; |
108 | - }elseif (Str::contains(strtolower($label),["email","mail"])) { |
|
110 | + } elseif (Str::contains(strtolower($label),["email","mail"])) { |
|
109 | 111 | $type = "email"; |
110 | - }elseif (Str::contains(strtolower($label),["description","content","detail"])) { |
|
112 | + } elseif (Str::contains(strtolower($label),["description","content","detail"])) { |
|
111 | 113 | $type = "wysiwyg"; |
112 | - }elseif (Str::contains(strtolower($label),["price","money","grand_total","tax"])) { |
|
114 | + } elseif (Str::contains(strtolower($label),["price","money","grand_total","tax"])) { |
|
113 | 115 | $type = "money"; |
114 | - }elseif (Str::contains(strtolower($label),["quantity","qty","total","phone","telp"])) { |
|
116 | + } elseif (Str::contains(strtolower($label),["quantity","qty","total","phone","telp"])) { |
|
115 | 117 | $type = "number"; |
116 | - }elseif (Str::contains(strtolower($label),["date"])) { |
|
118 | + } elseif (Str::contains(strtolower($label),["date"])) { |
|
117 | 119 | $type = "date"; |
118 | 120 | } |
119 | 121 | |
@@ -219,7 +221,7 @@ discard block |
||
219 | 221 | |
220 | 222 | if($item['length']) { |
221 | 223 | $structureItems .= "\$table->".$item['type_data']."('".$item['field_name']."', ".$item['length'].")$nullable;\n\t\t\t"; |
222 | - }else{ |
|
224 | + } else{ |
|
223 | 225 | $structureItems .= "\$table->".$item['type_data']."('".$item['field_name']."')$nullable;\n\t\t\t"; |
224 | 226 | } |
225 | 227 | } |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | } |
113 | 113 | $scaffold .= '$this->add' . $methodName . '("' . $label . '","' . $column . '")->options('.min_var_export($optResult).')' . $additional . ';' . "\n\t\t"; |
114 | 114 | } |
115 | - }elseif (in_array($field['column_type'],['radio_table','select_table'])) { |
|
115 | + } elseif (in_array($field['column_type'],['radio_table','select_table'])) { |
|
116 | 116 | if ($optionTable && $optionValue && $optionDisplay) { |
117 | 117 | $scaffold .= '$this->add' . $methodName . '("' . $label . '","' . $column . '",["table"=>"' . $optionTable . '","value_option"=>"' . $optionValue . '","display_option"=>"' . $optionDisplay . '","sql_condition"=>"' . $optionSqlCondition . '"])' . $additional . ';' . "\n\t\t"; |
118 | 118 | } |
119 | - }elseif ($field['column_type'] == "select_query") { |
|
119 | + } elseif ($field['column_type'] == "select_query") { |
|
120 | 120 | if($sqlRawQuery && Str::contains($sqlRawQuery,["as `key`","as `label`"])) { |
121 | 121 | $scaffold .= '$this->add' . $methodName . '("' . $label . '","' . $column . '","'.$sqlRawQuery.'")' . $additional . ';' . "\n\t\t"; |
122 | 122 | } |
123 | - }else{ |
|
123 | + } else{ |
|
124 | 124 | $scaffold .= '$this->add'.$methodName.'("'.$label.'","'.$column.'")'.$additional.';'."\n\t\t"; |
125 | 125 | } |
126 | 126 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if($moduleData = DB::table("cb_modules")->where("name", $name)->where("table_name",$this->table)->first()) { |
147 | 147 | DB::table("cb_modules")->where("id",$moduleData->id)->update($module); |
148 | 148 | $id_modules = $moduleData->id; |
149 | - }else{ |
|
149 | + } else{ |
|
150 | 150 | $id_modules = DB::table('cb_modules')->insertGetId($module); |
151 | 151 | } |
152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $menu['cb_modules_id'] = $id_modules; |
158 | 158 | if(isset($moduleData)) { |
159 | 159 | DB::table("cb_menus")->where("cb_modules_id",$moduleData->id)->update($menu); |
160 | - }else{ |
|
160 | + } else{ |
|
161 | 161 | DB::table('cb_menus')->insertGetId($menu); |
162 | 162 | } |
163 | 163 |
@@ -27,13 +27,13 @@ |
||
27 | 27 | try { |
28 | 28 | if(@$this->command->option("password") == "AUTO" || !@$this->command->option("password")) { |
29 | 29 | $password = Str::random(16); |
30 | - }else{ |
|
30 | + } else{ |
|
31 | 31 | $password = $this->command->option("password"); |
32 | 32 | } |
33 | 33 | |
34 | 34 | if(@$this->command->option("username") == "AUTO" || !@$this->command->option("username")) { |
35 | 35 | $username = Str::random(5); |
36 | - }else{ |
|
36 | + } else{ |
|
37 | 37 | $username = $this->command->option("username"); |
38 | 38 | } |
39 | 39 | } catch (\Exception $e) { |
@@ -15,8 +15,11 @@ discard block |
||
15 | 15 | |
16 | 16 | public static function has($key) |
17 | 17 | { |
18 | - if(file_exists(app_path("CBPlugins/".$key))) return true; |
|
19 | - else return false; |
|
18 | + if(file_exists(app_path("CBPlugins/".$key))) { |
|
19 | + return true; |
|
20 | + } else { |
|
21 | + return false; |
|
22 | + } |
|
20 | 23 | } |
21 | 24 | |
22 | 25 | public static function isNeedUpgrade($pluginKey, $versionToCompare) |
@@ -24,7 +27,7 @@ discard block |
||
24 | 27 | $pluginJson = json_decode(file_get_contents(app_path("CBPlugins/".$pluginKey."/plugin.json")), true); |
25 | 28 | if($pluginJson) { |
26 | 29 | return version_compare($pluginJson['version'], $versionToCompare,"!="); |
27 | - }else{ |
|
30 | + } else{ |
|
28 | 31 | return false; |
29 | 32 | } |
30 | 33 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | DB::table("users")->where("id", auth()->id())->update($data); |
37 | - }catch (\Exception $e) { |
|
37 | + } catch (\Exception $e) { |
|
38 | 38 | Log::error($e); |
39 | 39 | return cb()->redirectBack(cbLang("something_went_wrong"),"warning"); |
40 | 40 | } |