@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | $user = $this->usersRepo->findByMail(request("email")); |
| 32 | 32 | |
| 33 | - if (! auth('cbAdmin')->attempt($credentials)) { |
|
| 33 | + if (!auth('cbAdmin')->attempt($credentials)) { |
|
| 34 | 34 | $resp = redirect()->route('getLogin')->with('message', cbTrans('alert_password_wrong')); |
| 35 | 35 | respondWith($resp); |
| 36 | 36 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function uploadFile($name) |
| 12 | 12 | { |
| 13 | - if (! Request::hasFile($name)) { |
|
| 13 | + if (!Request::hasFile($name)) { |
|
| 14 | 14 | return null; |
| 15 | 15 | } |
| 16 | 16 | $file = Request::file($name); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | private function validateExtension($ext) |
| 35 | 35 | { |
| 36 | - if (! FieldDetector::isUploadField($ext)) { |
|
| 36 | + if (!FieldDetector::isUploadField($ext)) { |
|
| 37 | 37 | respondWith()->json("The filetype is not allowed!"); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | private function sendMail($html, $subject, $template) |
| 49 | 49 | { |
| 50 | - \Mail::send("CbEmailTpl::templates.blank", ['content' => $html], function ($message) use ($subject, $template) { |
|
| 50 | + \Mail::send("CbEmailTpl::templates.blank", ['content' => $html], function($message) use ($subject, $template) { |
|
| 51 | 51 | $message->priority(1); |
| 52 | 52 | $message->to($this->receiver); |
| 53 | 53 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | |
| 78 | 78 | private function validateForgotPass() |
| 79 | 79 | { |
| 80 | - $validator = \Validator::make(request()->all(), ['email' => 'required|email|exists:cms_users',]); |
|
| 80 | + $validator = \Validator::make(request()->all(), ['email' => 'required|email|exists:cms_users', ]); |
|
| 81 | 81 | |
| 82 | 82 | if ($validator->fails()) { |
| 83 | 83 | $message = $validator->errors()->all(); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $format_validation[] = $this->existOrUnique($config, $type); |
| 28 | 28 | } elseif (in_array($type, ['date_format', 'digits_between', 'in', 'mimes', 'min', 'max', 'not_in'])) { |
| 29 | 29 | $format_validation[] = $type.':'.$config; |
| 30 | - } elseif (! in_array($type, $typeExcept)) { |
|
| 30 | + } elseif (!in_array($type, $typeExcept)) { |
|
| 31 | 31 | $format_validation[] = $type; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $row = $data->first(); |
| 20 | 20 | |
| 21 | - if (! $row) { |
|
| 21 | + if (!$row) { |
|
| 22 | 22 | return ApiResponder::makeResult(0, 'There is no data found !'); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | self::passwordError($posts, $ctrl); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! $required && $used && $value) { |
|
| 43 | + if (!$required && $used && $value) { |
|
| 44 | 44 | self::passwordError($posts, $ctrl); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $result = ApiResponder::makeResult(1, 'success'); |
| 71 | 71 | |
| 72 | - return array_merge($result, (array)$rows); |
|
| 72 | + return array_merge($result, (array) $rows); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $rows->$k = asset($v); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if (! in_array($k, $responsesFields)) { |
|
| 86 | + if (!in_array($k, $responsesFields)) { |
|
| 87 | 87 | unset($rows->$k); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | ApiResponder::send($result, $posts, $this->ctrl); |
| 62 | 62 | } elseif (in_array($actionType, ['save_add', 'save_edit'])) { |
| 63 | - $rowAssign = array_filter($input_validator, function ($column) use ($table) { |
|
| 63 | + $rowAssign = array_filter($input_validator, function($column) use ($table) { |
|
| 64 | 64 | return Schema::hasColumn($table, $column); |
| 65 | 65 | }, ARRAY_FILTER_USE_KEY); |
| 66 | 66 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private function filterRows($data, $parameters, $posts, $table, $typeExcept) |
| 115 | 115 | { |
| 116 | - $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) { |
|
| 116 | + $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) { |
|
| 117 | 117 | foreach ($parameters as $param) { |
| 118 | 118 | $name = $param['name']; |
| 119 | 119 | $type = $param['type']; |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | private function applyLike($data, $search_in, $value) |
| 253 | 253 | { |
| 254 | - $data->where(function ($w) use ($search_in, $value) { |
|
| 254 | + $data->where(function($w) use ($search_in, $value) { |
|
| 255 | 255 | foreach ($search_in as $k => $field) { |
| 256 | 256 | $method = 'orWhere'; |
| 257 | 257 | if ($k == 0) { |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp) |
| 274 | 274 | { |
| 275 | - if (! DbInspector::isForeignKey($name)) { |
|
| 275 | + if (!DbInspector::isForeignKey($name)) { |
|
| 276 | 276 | return $nameTmp; |
| 277 | 277 | } |
| 278 | 278 | $joinTable = DbInspector::getRelatedTableName($name); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | private function doValidation($inputValidator, $dataValidation, $posts) |
| 298 | 298 | { |
| 299 | 299 | $validator = Validator::make($inputValidator, $dataValidation); |
| 300 | - if (! $validator->fails()) { |
|
| 300 | + if (!$validator->fails()) { |
|
| 301 | 301 | return true; |
| 302 | 302 | } |
| 303 | 303 | $message = $validator->errors()->all(); |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | private function filterRedundantResp($responses) |
| 315 | 315 | { |
| 316 | - $responses = array_filter($responses, function ($resp) { |
|
| 317 | - return ! ($resp['name'] == 'ref_id' || $resp['type'] == 'custom'); |
|
| 316 | + $responses = array_filter($responses, function($resp) { |
|
| 317 | + return !($resp['name'] == 'ref_id' || $resp['type'] == 'custom'); |
|
| 318 | 318 | }); |
| 319 | 319 | |
| 320 | - $responses = array_filter($responses, function ($resp) { |
|
| 320 | + $responses = array_filter($responses, function($resp) { |
|
| 321 | 321 | return (intval($resp['used']) != 0 || DbInspector::isForeignKey($resp['name'])); |
| 322 | 322 | }); |
| 323 | 323 | |
@@ -332,15 +332,15 @@ discard block |
||
| 332 | 332 | private function validateParams($parameters, $table) |
| 333 | 333 | { |
| 334 | 334 | $posts = request()->all(); |
| 335 | - if (! $parameters) { |
|
| 335 | + if (!$parameters) { |
|
| 336 | 336 | return ['', '']; |
| 337 | 337 | } |
| 338 | 338 | $typeExcept = ['password', 'ref', 'base64_file', 'custom', 'search']; |
| 339 | 339 | $inputValidator = []; |
| 340 | 340 | $dataValidation = []; |
| 341 | 341 | |
| 342 | - $parameters = array_filter($parameters, function ($param){ |
|
| 343 | - return !(is_string($param['config'])&& !starts_with($param['config'], '*')); |
|
| 342 | + $parameters = array_filter($parameters, function($param) { |
|
| 343 | + return !(is_string($param['config']) && !starts_with($param['config'], '*')); |
|
| 344 | 344 | }); |
| 345 | 345 | |
| 346 | 346 | foreach ($parameters as $param) { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | { |
| 45 | 45 | $ctrl->hookValidate(); |
| 46 | 46 | |
| 47 | - if (! $ctrl->validate) { |
|
| 47 | + if (!$ctrl->validate) { |
|
| 48 | 48 | return true; |
| 49 | 49 | } // hook have to return true |
| 50 | 50 | //todo : translation |
@@ -71,19 +71,19 @@ discard block |
||
| 71 | 71 | $data['result'] = $query->take($limit)->get(); |
| 72 | 72 | $totalData = count($data['result']); |
| 73 | 73 | return $data; |
| 74 | - }else{ |
|
| 74 | + } else { |
|
| 75 | 75 | $data['result'] = $query->paginate($limit); |
| 76 | 76 | $totalData = $data['result']->total(); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | $number = (request('page', 1) - 1) * $limit + 1; |
| 81 | - $columnsTable = array_filter($columns, function ($col) { |
|
| 81 | + $columnsTable = array_filter($columns, function($col) { |
|
| 82 | 82 | return $col['visible'] ?? true; |
| 83 | 83 | }); |
| 84 | 84 | $htmlContents = (new RowContent($CbCtrl))->calculate($data, $number, $columnsTable); //end foreach data[result] |
| 85 | 85 | |
| 86 | - $data['html_contents'] = ['html' => $htmlContents, 'data' => $data['result'],'total'=>$totalData]; |
|
| 86 | + $data['html_contents'] = ['html' => $htmlContents, 'data' => $data['result'], 'total'=>$totalData]; |
|
| 87 | 87 | |
| 88 | 88 | return $data; |
| 89 | 89 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $data['parent_field'] = DbInspector::getRelatedTableName($parent); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - if (! $data['parent_field']) { |
|
| 105 | + if (!$data['parent_field']) { |
|
| 106 | 106 | return $data; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | private function _filterForParent($result) |
| 123 | 123 | { |
| 124 | - if (! request('parent_id')) { |
|
| 124 | + if (!request('parent_id')) { |
|
| 125 | 125 | return null; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | private function _applyWhereAndQfilters($result, $columnsTable, $table) |
| 193 | 193 | { |
| 194 | 194 | if (request('q')) { |
| 195 | - $result->where(function ($query) use ($columnsTable) { |
|
| 195 | + $result->where(function($query) use ($columnsTable) { |
|
| 196 | 196 | foreach ($columnsTable as $col) { |
| 197 | - if (! $col['field_with']) { |
|
| 197 | + if (!$col['field_with']) { |
|
| 198 | 198 | continue; |
| 199 | 199 | } |
| 200 | 200 | $query->orwhere($col['field_with'], "like", "%".request("q")."%"); |