@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | if (in_array($actionType, ['save_add', 'save_edit'])) { |
119 | - $rowAssign = array_filter($input_validator, function ($column) use ($table) { |
|
119 | + $rowAssign = array_filter($input_validator, function($column) use ($table) { |
|
120 | 120 | return \Schema::hasColumn($table, $column); |
121 | 121 | }, ARRAY_FILTER_USE_KEY); |
122 | 122 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | private function filterRows($data, $parameters, $posts, $table, $typeExcept) |
230 | 230 | { |
231 | - $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) { |
|
231 | + $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) { |
|
232 | 232 | foreach ($parameters as $param) { |
233 | 233 | $name = $param['name']; |
234 | 234 | $type = $param['type']; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $row->$k = asset($v); |
321 | 321 | } |
322 | 322 | |
323 | - if (! in_array($k, $responsesFields)) { |
|
323 | + if (!in_array($k, $responsesFields)) { |
|
324 | 324 | unset($row[$k]); |
325 | 325 | } |
326 | 326 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $rows->$k = asset($v); |
384 | 384 | } |
385 | 385 | |
386 | - if (! in_array($k, $responsesFields)) { |
|
386 | + if (!in_array($k, $responsesFields)) { |
|
387 | 387 | unset($row[$k]); |
388 | 388 | } |
389 | 389 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $subquery = $resp['subquery']; |
407 | 407 | $used = intval($resp['used']); |
408 | 408 | |
409 | - if ($used == 0 && ! DbInspector::isForeignKey($name)) { |
|
409 | + if ($used == 0 && !DbInspector::isForeignKey($name)) { |
|
410 | 410 | continue; |
411 | 411 | } |
412 | 412 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | */ |
462 | 462 | private function applyLike($data, $search_in, $value) |
463 | 463 | { |
464 | - $data->where(function ($w) use ($search_in, $value) { |
|
464 | + $data->where(function($w) use ($search_in, $value) { |
|
465 | 465 | foreach ($search_in as $k => $field) { |
466 | 466 | if ($k == 0) { |
467 | 467 | $w->where($field, "like", "%$value%"); |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | */ |
483 | 483 | private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp) |
484 | 484 | { |
485 | - if (! DbInspector::isForeignKey($name)) { |
|
485 | + if (!DbInspector::isForeignKey($name)) { |
|
486 | 486 | return $nameTmp; |
487 | 487 | } |
488 | 488 | $jointable = CRUDBooster::getTableForeignKey($name); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | private function validateMethodType($row_api, $result, $debugModeMessage, $posts) |
510 | 510 | { |
511 | 511 | $methodType = $row_api->method_type; |
512 | - if (! $methodType || ! Request::isMethod($methodType)) { |
|
512 | + if (!$methodType || !Request::isMethod($methodType)) { |
|
513 | 513 | $result['api_status'] = 0; |
514 | 514 | $result['api_message'] = "The request method is not allowed !"; |
515 | 515 | |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | */ |
548 | 548 | private function checkApiDefined($row_api, $result, $debugModeMessage, $posts) |
549 | 549 | { |
550 | - if (! $row_api) { |
|
550 | + if (!$row_api) { |
|
551 | 551 | $result['api_status'] = 0; |
552 | 552 | $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.'; |
553 | 553 | |
@@ -617,11 +617,11 @@ discard block |
||
617 | 617 | $value = $param['config']; |
618 | 618 | } |
619 | 619 | |
620 | - if ($required && $type == 'password' && ! Hash::check($value, $row->{$name})) { |
|
620 | + if ($required && $type == 'password' && !Hash::check($value, $row->{$name})) { |
|
621 | 621 | $this->passwordError($result, $debugModeMessage, $posts); |
622 | 622 | } |
623 | 623 | |
624 | - if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) { |
|
624 | + if (!$required && $used && $value && !Hash::check($value, $row->{$name})) { |
|
625 | 625 | $this->passwordError($result, $debugModeMessage, $posts); |
626 | 626 | } |
627 | 627 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | $this->cbLoader(); |
24 | 24 | $selectedIds = request('checkbox'); |
25 | 25 | $btnName = request('button_name'); |
26 | - if (! $selectedIds) { |
|
26 | + if (!$selectedIds) { |
|
27 | 27 | CRUDBooster::redirect($_SERVER['HTTP_REFERER'], 'Please select at least one row!', 'warning'); |
28 | 28 | } |
29 | 29 | if ($btnName == 'delete') { |
30 | 30 | (new DataRemover($this))->doDeleteWithHook($selectedIds); |
31 | - $this->insertLog('log_delete', implode(',', $selectedIds) . ' - '. $this->table); |
|
31 | + $this->insertLog('log_delete', implode(',', $selectedIds).' - '.$this->table); |
|
32 | 32 | backWithMsg(cbTrans('alert_delete_selected_success')); |
33 | 33 | } |
34 | 34 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | $message = cbTrans('alert_action', ['action' => $action]); |
48 | 48 | |
49 | 49 | if ($this->actionButtonSelected($id_selected, $button_name) === false) { |
50 | - $message = ! empty($this->alert['message']) ? $this->alert['message'] : 'Error'; |
|
51 | - $type = ! empty($this->alert['type']) ? $this->alert['type'] : 'danger'; |
|
50 | + $message = !empty($this->alert['message']) ? $this->alert['message'] : 'Error'; |
|
51 | + $type = !empty($this->alert['type']) ? $this->alert['type'] : 'danger'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | backWithMsg($message, $type); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | $this->findRow($id)->update([$column => null]); |
69 | 69 | |
70 | - $this->insertLog('log_delete_image', $id . ' - '. $this->table); |
|
70 | + $this->insertLog('log_delete_image', $id.' - '.$this->table); |
|
71 | 71 | |
72 | 72 | CRUDBooster::redirect(Request::server('HTTP_REFERER'), cbTrans('alert_delete_data_success'), 'success'); |
73 | 73 | } |
@@ -19,12 +19,12 @@ |
||
19 | 19 | $data['page_menu'] = Route::getCurrentRoute()->getActionName(); |
20 | 20 | $data['page_title'] = 'Import Data '.CRUDBooster::getCurrentModule()->name; |
21 | 21 | |
22 | - if (! request('file') || request('import')) { |
|
22 | + if (!request('file') || request('import')) { |
|
23 | 23 | return $this->cbView('crudbooster::import', $data); |
24 | 24 | } |
25 | 25 | |
26 | 26 | $file = 'storage'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.base64_decode(request('file')); |
27 | - $rows = Excel::load($file, function ($reader) { |
|
27 | + $rows = Excel::load($file, function($reader) { |
|
28 | 28 | })->get(); |
29 | 29 | |
30 | 30 | session()->put('total_data_import', count($rows)); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $validator = Validator::make(request()->all(), $rules); |
21 | 21 | |
22 | - if (! $validator->fails()) { |
|
22 | + if (!$validator->fails()) { |
|
23 | 23 | return null; |
24 | 24 | } |
25 | 25 | |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | $rules = []; |
38 | 38 | foreach ($form as $formInput) { |
39 | 39 | $name = $formInput['name']; |
40 | - if (! $name) { |
|
40 | + if (!$name) { |
|
41 | 41 | continue; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $ai = []; |
45 | - if ($formInput['required'] && ! Request::hasFile($name)) { |
|
45 | + if ($formInput['required'] && !Request::hasFile($name)) { |
|
46 | 46 | $ai[] = 'required'; |
47 | 47 | } |
48 | 48 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $exp = explode('|', $formInput['validation']); |
73 | 73 | |
74 | - $uniqueRules = array_filter($exp, function($item){ |
|
74 | + $uniqueRules = array_filter($exp, function($item) { |
|
75 | 75 | return starts_with($item, 'unique'); |
76 | 76 | }); |
77 | 77 |
@@ -119,7 +119,7 @@ |
||
119 | 119 | continue; |
120 | 120 | } |
121 | 121 | |
122 | - $s = str_replace("'", '',$s); |
|
122 | + $s = str_replace("'", '', $s); |
|
123 | 123 | list($key, $val) = explode('=>', $s); |
124 | 124 | $colInnerItem[$key] = $val; |
125 | 125 |