@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $datatableWhere = urldecode(request('datatable_where')); |
16 | 16 | $foreignKeyName = request('fk_name'); |
17 | 17 | $foreignKeyValue = request('fk_value'); |
18 | - if (! $table || ! $label || ! $foreignKeyName || ! $foreignKeyValue) { |
|
18 | + if (!$table || !$label || !$foreignKeyName || !$foreignKeyValue) { |
|
19 | 19 | return response()->json([]); |
20 | 20 | } |
21 | 21 | $query = DB::table($table); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function getDataQuery() |
52 | 52 | { |
53 | 53 | $key = request('query'); |
54 | - if (! Cache::has($key)) { |
|
54 | + if (!Cache::has($key)) { |
|
55 | 55 | return response()->json(['items' => []]); |
56 | 56 | } |
57 | 57 | $query = Cache::get($key); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | if (request('q')) { |
94 | 94 | return; |
95 | 95 | } |
96 | - $result->where(function ($where) use ($columns) { |
|
96 | + $result->where(function($where) use ($columns) { |
|
97 | 97 | foreach ($columns as $c => $col) { |
98 | 98 | if ($c == 0) { |
99 | 99 | $where->where($col, 'like', '%'.request('q').'%'); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | * @param $name |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - /* private function handleBase64($value, $uploads_format_candidate, $row_assign, $name) |
|
77 | + /* private function handleBase64($value, $uploads_format_candidate, $row_assign, $name) |
|
78 | 78 | { |
79 | 79 | $filedata = base64_decode($value); |
80 | 80 | $f = finfo_open(); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | private function filterRows($data, $parameters, $posts, $table, $type_except) |
228 | 228 | { |
229 | - $data->where(function ($w) use ($parameters, $posts, $table, $type_except) { |
|
229 | + $data->where(function($w) use ($parameters, $posts, $table, $type_except) { |
|
230 | 230 | foreach ($parameters as $param) { |
231 | 231 | $name = $param['name']; |
232 | 232 | $type = $param['type']; |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $row->$k = asset($v); |
319 | 319 | } |
320 | 320 | |
321 | - if (! in_array($k, $responses_fields)) { |
|
321 | + if (!in_array($k, $responses_fields)) { |
|
322 | 322 | unset($row[$k]); |
323 | 323 | } |
324 | 324 | } |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $rows->$k = asset($v); |
382 | 382 | } |
383 | 383 | |
384 | - if (! in_array($k, $responses_fields)) { |
|
384 | + if (!in_array($k, $responses_fields)) { |
|
385 | 385 | unset($row[$k]); |
386 | 386 | } |
387 | 387 | } |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $subquery = $resp['subquery']; |
404 | 404 | $used = intval($resp['used']); |
405 | 405 | |
406 | - if ($used == 0 && ! DbInspector::isForeignKey($name)) { |
|
406 | + if ($used == 0 && !DbInspector::isForeignKey($name)) { |
|
407 | 407 | continue; |
408 | 408 | } |
409 | 409 | |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | */ |
459 | 459 | private function applyLike($data, $search_in, $value) |
460 | 460 | { |
461 | - $data->where(function ($w) use ($search_in, $value) { |
|
461 | + $data->where(function($w) use ($search_in, $value) { |
|
462 | 462 | foreach ($search_in as $k => $field) { |
463 | 463 | if ($k == 0) { |
464 | 464 | $w->where($field, "like", "%$value%"); |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | private function validateMethodType($row_api, $result, $debugModeMessage, $posts) |
507 | 507 | { |
508 | 508 | $method_type = $row_api->method_type; |
509 | - if (! $method_type || ! Request::isMethod($method_type)) { |
|
509 | + if (!$method_type || !Request::isMethod($method_type)) { |
|
510 | 510 | $result['api_status'] = 0; |
511 | 511 | $result['api_message'] = "The request method is not allowed !"; |
512 | 512 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | */ |
545 | 545 | private function checkApiDefined($row_api, $result, $debugModeMessage, $posts) |
546 | 546 | { |
547 | - if (! $row_api) { |
|
547 | + if (!$row_api) { |
|
548 | 548 | $result['api_status'] = 0; |
549 | 549 | $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.'; |
550 | 550 | |
@@ -611,11 +611,11 @@ discard block |
||
611 | 611 | $value = $param['config']; |
612 | 612 | } |
613 | 613 | |
614 | - if ($required && $type == 'password' && ! Hash::check($value, $row->{$name})) { |
|
614 | + if ($required && $type == 'password' && !Hash::check($value, $row->{$name})) { |
|
615 | 615 | $this->passwordError($result, $debugModeMessage, $posts); |
616 | 616 | } |
617 | 617 | |
618 | - if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) { |
|
618 | + if (!$required && $used && $value && !Hash::check($value, $row->{$name})) { |
|
619 | 619 | $this->passwordError($result, $debugModeMessage, $posts); |
620 | 620 | } |
621 | 621 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $data['parent_field'] = CB::getTableForeignKey(request('parent_table'), $this->table); |
109 | 109 | } |
110 | 110 | |
111 | - if (! $data['parent_field']) { |
|
111 | + if (!$data['parent_field']) { |
|
112 | 112 | return $data; |
113 | 113 | } |
114 | 114 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function _filterForParent($result) |
128 | 128 | { |
129 | - if (! request('parent_id')) { |
|
129 | + if (!request('parent_id')) { |
|
130 | 130 | return null; |
131 | 131 | } |
132 | 132 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | private function _filterOutSoftDeleted($tableColumns, $result) |
142 | 142 | { |
143 | - if (! in_array('deleted_at', $tableColumns)) { |
|
143 | + if (!in_array('deleted_at', $tableColumns)) { |
|
144 | 144 | return; |
145 | 145 | } |
146 | 146 | $result->where($this->table.'.deleted_at', '=', null); |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | private function _applyWhereAndQfilters($result, $columnsTable, $table) |
200 | 200 | { |
201 | 201 | if (request('q')) { |
202 | - $result->where(function ($query) use ($columnsTable) { |
|
202 | + $result->where(function($query) use ($columnsTable) { |
|
203 | 203 | foreach ($columnsTable as $col) { |
204 | - if (! $col['field_with']) { |
|
204 | + if (!$col['field_with']) { |
|
205 | 205 | continue; |
206 | 206 | } |
207 | 207 | $query->orwhere($col['field_with'], "like", "%".request("q")."%"); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | return CRUDBooster::adminPath($module['path']).'?parent_table='.$table_parent.'&parent_columns=' |
274 | 274 | .$module['parent_columns'].'&parent_columns_alias=' |
275 | 275 | .$module['parent_columns_alias'].'&parent_id=[' |
276 | - .(! isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id']) |
|
276 | + .(!isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id']) |
|
277 | 277 | .']&return_url='.urlencode(Request::fullUrl()).'&foreign_key=' |
278 | 278 | .$module['foreign_key'].'&label='.urlencode($module['label']); |
279 | 279 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public static function first($table, $id) |
111 | 111 | { |
112 | 112 | $table = self::parseSqlTable($table)['table']; |
113 | - if (! is_array($id)) { |
|
113 | + if (!is_array($id)) { |
|
114 | 114 | $pk = DbInspector::findPK($table); |
115 | 115 | |
116 | 116 | return DB::table($table)->where($pk, $id)->first(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $controllerName = basename($controllerName); |
144 | 144 | $route_url = route($controllerName.'GetIndex'); |
145 | 145 | |
146 | - if (! $path) { |
|
146 | + if (!$path) { |
|
147 | 147 | return trim($route_url, '/'); |
148 | 148 | } |
149 | 149 |