@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | $this->table = 'cms_moduls'; |
18 | 18 | $this->primaryKey = 'id'; |
19 | - $this->title_field = 'name' ; |
|
19 | + $this->title_field = 'name'; |
|
20 | 20 | $this->limit = 100; |
21 | 21 | $this->button_add = false; |
22 | 22 | $this->buttonExport = false; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $this->orderby = ['is_protected' => 'asc', 'name' => 'asc']; |
29 | 29 | |
30 | 30 | $this->col = []; |
31 | - $this->col[] = ['label' => 'name', 'name' => 'name' ]; |
|
31 | + $this->col[] = ['label' => 'name', 'name' => 'name']; |
|
32 | 32 | $this->col[] = ['label' => "Table", 'name' => "table_name"]; |
33 | 33 | $this->col[] = ['label' => "Path", 'name' => "path"]; |
34 | 34 | $this->col[] = ['label' => "Controller", 'name' => "controller"]; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $this->form[] = ['label' => 'Controller', 'name' => 'controller', 'type' => 'text', 'placeholder' => '(Optional) Auto Generated']; |
251 | 251 | |
252 | 252 | if (in_array(CRUDBooster::getCurrentMethod(), ['getAdd', 'postAddSave'])) { |
253 | - return ; |
|
253 | + return; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | $this->form[] = [ |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $data['parent_field'] = CRUDBooster::getTableForeignKey(request('parent_table'), $this->table); |
108 | 108 | } |
109 | 109 | |
110 | - if (! $data['parent_field']) { |
|
110 | + if (!$data['parent_field']) { |
|
111 | 111 | return $data; |
112 | 112 | } |
113 | 113 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | private function _filterForParent($result) |
127 | 127 | { |
128 | - if (! request('parent_id')) { |
|
128 | + if (!request('parent_id')) { |
|
129 | 129 | return null; |
130 | 130 | } |
131 | 131 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | private function _filterOutSoftDeleted($tableColumns, $result) |
141 | 141 | { |
142 | - if (! in_array('deleted_at', $tableColumns)) { |
|
142 | + if (!in_array('deleted_at', $tableColumns)) { |
|
143 | 143 | return; |
144 | 144 | } |
145 | 145 | $result->where($this->table.'.deleted_at', '=', null); |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | private function _applyWhereAndQfilters($result, $columnsTable, $table) |
199 | 199 | { |
200 | 200 | if (request('q')) { |
201 | - $result->where(function ($query) use ($columnsTable) { |
|
201 | + $result->where(function($query) use ($columnsTable) { |
|
202 | 202 | foreach ($columnsTable as $col) { |
203 | - if (! $col['field_with']) { |
|
203 | + if (!$col['field_with']) { |
|
204 | 204 | continue; |
205 | 205 | } |
206 | 206 | $query->orwhere($col['field_with'], "like", "%".request("q")."%"); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | return CRUDBooster::adminPath($module['path']).'?parent_table='.$table_parent.'&parent_columns=' |
273 | 273 | .$module['parent_columns'].'&parent_columns_alias=' |
274 | 274 | .$module['parent_columns_alias'].'&parent_id=[' |
275 | - .(! isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id']) |
|
275 | + .(!isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id']) |
|
276 | 276 | .']&return_url='.urlencode(Request::fullUrl()).'&foreign_key=' |
277 | 277 | .$module['foreign_key'].'&label='.urlencode($module['label']); |
278 | 278 | } |
@@ -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)); |