@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $props = array_get($map, FieldDetector::detect($colName), null); |
90 | 90 | unset($map); |
91 | - if($props !== null){ |
|
91 | + if ($props !== null) { |
|
92 | 92 | $input = array_merge($input, $props); |
93 | 93 | } |
94 | 94 | |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | $arr = array_get([ |
130 | 130 | 'string' => $default, |
131 | 131 | 'text' => ['textarea', "string|min:5", []], |
132 | - 'date' => ['date', "date", ['php_format' => 'M, d Y', 'datepicker_format' => 'M, dd YYYY',]], |
|
133 | - 'datetime' => ['datetime', "date_format:Y-m-d H:i:s", ['php_format' => 'M, d Y H:i',]], |
|
132 | + 'date' => ['date', "date", ['php_format' => 'M, d Y', 'datepicker_format' => 'M, dd YYYY', ]], |
|
133 | + 'datetime' => ['datetime', "date_format:Y-m-d H:i:s", ['php_format' => 'M, d Y H:i', ]], |
|
134 | 134 | 'time' => ['time', 'date_format:H:i:s', []], |
135 | 135 | 'double' => ['money', "integer|min:0", []], |
136 | 136 | 'int' => ['number', 'integer|min:0', []], |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | private static function handleForeignKey($field) |
151 | 151 | { |
152 | 152 | $jointable = str_replace(['id_', '_id'], '', $field); |
153 | - if (! Schema::hasTable($jointable)) { |
|
153 | + if (!Schema::hasTable($jointable)) { |
|
154 | 154 | return ['', '']; |
155 | 155 | } |
156 | 156 | $options = [ |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | $this->table = 'cms_moduls'; |
17 | 17 | $this->primaryKey = 'id'; |
18 | - $this->title_field = 'name' ; |
|
18 | + $this->title_field = 'name'; |
|
19 | 19 | $this->limit = 100; |
20 | 20 | $this->button_add = false; |
21 | 21 | $this->buttonExport = false; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $this->orderby = ['is_protected' => 'asc', 'name' => 'asc']; |
28 | 28 | |
29 | 29 | $this->col = []; |
30 | - $this->col[] = ['label' => 'name', 'name' => 'name' ]; |
|
30 | + $this->col[] = ['label' => 'name', 'name' => 'name']; |
|
31 | 31 | $this->col[] = ['label' => "Table", 'name' => "table_name"]; |
32 | 32 | $this->col[] = ['label' => "Path", 'name' => "path"]; |
33 | 33 | $this->col[] = ['label' => "Controller", 'name' => "controller"]; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public static function findPK($table) |
18 | 18 | { |
19 | - if (! $table) { |
|
19 | + if (!$table) { |
|
20 | 20 | return 'id'; |
21 | 21 | } |
22 | 22 | |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | } |
26 | 26 | $table = CRUDBooster::parseSqlTable($table); |
27 | 27 | |
28 | - if (! $table['table']) { |
|
28 | + if (!$table['table']) { |
|
29 | 29 | throw new \Exception("parseSqlTable can't determine the table"); |
30 | 30 | } |
31 | 31 | |
32 | 32 | $primaryKey = self::findPKname($table); |
33 | 33 | |
34 | - if (! $primaryKey) { |
|
34 | + if (!$primaryKey) { |
|
35 | 35 | return 'id'; |
36 | 36 | } |
37 | 37 | CbCache::put('table_'.$table, 'primaryKey', $primaryKey); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | $table = self::getTableForeignKey($fieldName); |
99 | - if (! $table) { |
|
99 | + if (!$table) { |
|
100 | 100 | return false; |
101 | 101 | } |
102 | 102 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | |
179 | - $tables = array_map(function ($table) { |
|
179 | + $tables = array_map(function($table) { |
|
180 | 180 | return $table->TABLE_NAME; |
181 | 181 | }, $tables); |
182 | 182 |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public static function first($table, $id) |
110 | 110 | { |
111 | 111 | $table = self::parseSqlTable($table)['table']; |
112 | - if (! is_array($id)) { |
|
112 | + if (!is_array($id)) { |
|
113 | 113 | $pk = DbInspector::findPK($table); |
114 | 114 | |
115 | 115 | return DB::table($table)->where($pk, $id)->first(); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $controllerName = basename($controllerName); |
136 | 136 | $route_url = route($controllerName.'GetIndex'); |
137 | 137 | |
138 | - if (! $path) { |
|
138 | + if (!$path) { |
|
139 | 139 | return trim($route_url, '/'); |
140 | 140 | } |
141 | 141 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | $tables = DbInspector::listTables(); |
167 | 167 | |
168 | - $filter = function ($tableName) { |
|
168 | + $filter = function($tableName) { |
|
169 | 169 | |
170 | 170 | if ($tableName == config('database.migrations')) { |
171 | 171 | return false; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $filterColumn = $this->filterFalsyValues($filterColumn); |
37 | 37 | |
38 | - $result->where(function ($query) use ($filterColumn) { |
|
38 | + $result->where(function($query) use ($filterColumn) { |
|
39 | 39 | foreach ($filterColumn as $key => $fc) { |
40 | 40 | |
41 | 41 | $value = @$fc['value']; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | case 'in': |
59 | 59 | case 'not in': |
60 | 60 | $value = explode(',', $value); |
61 | - if (! empty($value)) { |
|
61 | + if (!empty($value)) { |
|
62 | 62 | $query->whereIn($key, $value); |
63 | 63 | } |
64 | 64 | break; |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | */ |
103 | 103 | private function filterFalsyValues($filterColumn) |
104 | 104 | { |
105 | - return array_filter($filterColumn, function ($fc) { |
|
105 | + return array_filter($filterColumn, function($fc) { |
|
106 | 106 | $value = @$fc['value']; |
107 | 107 | $type = @$fc['type']; |
108 | 108 | |
109 | - if (($type == 'between') || ! $value || ! $type) { |
|
109 | + if (($type == 'between') || !$value || !$type) { |
|
110 | 110 | return false; |
111 | 111 | } |
112 | 112 |