@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::table('cms_apicustom', function (Blueprint $table) { |
|
| 15 | + Schema::table('cms_apicustom', function(Blueprint $table) { |
|
| 16 | 16 | // |
| 17 | 17 | $table->string('method_type', 25)->nullable(); |
| 18 | 18 | }); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function down() |
| 27 | 27 | { |
| 28 | - Schema::table('cms_apicustom', function (Blueprint $table) { |
|
| 28 | + Schema::table('cms_apicustom', function(Blueprint $table) { |
|
| 29 | 29 | // |
| 30 | 30 | $table->dropColumn('method_type'); |
| 31 | 31 | }); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('cms_dashboard', function (Blueprint $table) { |
|
| 15 | + Schema::create('cms_dashboard', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | |
| 18 | 18 | $table->string('name')->nullable(); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('cms_statistic_components', function (Blueprint $table) { |
|
| 15 | + Schema::create('cms_statistic_components', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->integer('id_cms_statistics')->nullable(); |
| 18 | 18 | $table->string('componentID')->nullable(); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('cms_email_templates', function (Blueprint $table) { |
|
| 15 | + Schema::create('cms_email_templates', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('name')->nullable(); |
| 18 | 18 | $table->string('slug')->nullable(); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::table('cms_logs', function (Blueprint $table) { |
|
| 15 | + Schema::table('cms_logs', function(Blueprint $table) { |
|
| 16 | 16 | // |
| 17 | 17 | $table->text('details')->nullable()->after('description'); |
| 18 | 18 | }); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function down() |
| 27 | 27 | { |
| 28 | - Schema::table('cms_logs', function (Blueprint $table) { |
|
| 28 | + Schema::table('cms_logs', function(Blueprint $table) { |
|
| 29 | 29 | // |
| 30 | 30 | $table->dropColumn('details'); |
| 31 | 31 | }); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | 'filter_in' => 'В', |
| 211 | 211 | 'filter_not_in' => 'НЕ В', |
| 212 | 212 | 'filter_between' => 'В ДИАПАЗОНЕ', |
| 213 | - 'filter_empty_or_null' => '<Пусто> (или NULL)', //SVV |
|
| 213 | + 'filter_empty_or_null' => '<Пусто> (или NULL)', //SVV |
|
| 214 | 214 | |
| 215 | 215 | 'filter_sort_ascending' => 'Сорт. по возр.', |
| 216 | 216 | 'filter_sort_descending' => 'Сорт. по убыв.', |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | 'datamodal_select'=>'Выбрать', |
| 258 | 258 | 'datamodal_search_and_enter'=>'Найти и войти...', |
| 259 | 259 | 'datamodal_enter_to_search'=>'Нажмите Enter для поиска', |
| 260 | - 'datamodal_browse_data'=>'Выбрать данные' , |
|
| 261 | - 'datamodal_browse_file'=>'Выбрать файл' , |
|
| 260 | + 'datamodal_browse_data'=>'Выбрать данные', |
|
| 261 | + 'datamodal_browse_file'=>'Выбрать файл', |
|
| 262 | 262 | |
| 263 | 263 | |
| 264 | 264 | //child |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $this->cbLoader(); |
| 28 | 28 | |
| 29 | - if (! CRUDBooster::isSuperadmin()) { |
|
| 29 | + if (!CRUDBooster::isSuperadmin()) { |
|
| 30 | 30 | CRUDBooster::insertLog(trans("crudbooster.log_try_view", ['name' => 'API Index', 'module' => 'API'])); |
| 31 | 31 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 32 | 32 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $this->cbLoader(); |
| 129 | 129 | |
| 130 | - if (! CRUDBooster::isSuperadmin()) { |
|
| 130 | + if (!CRUDBooster::isSuperadmin()) { |
|
| 131 | 131 | CRUDBooster::insertLog(trans("crudbooster.log_try_view", ['name' => 'API Index', 'module' => 'API'])); |
| 132 | 132 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 133 | 133 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | { |
| 153 | 153 | $this->cbLoader(); |
| 154 | 154 | |
| 155 | - if (! CRUDBooster::isSuperadmin()) { |
|
| 155 | + if (!CRUDBooster::isSuperadmin()) { |
|
| 156 | 156 | CRUDBooster::insertLog(trans("crudbooster.log_try_view", ['name' => 'API Edit', 'module' => 'API'])); |
| 157 | 157 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 158 | 158 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $module = CRUDBooster::getCurrentModule(); |
| 217 | 217 | |
| 218 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 218 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 219 | 219 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 220 | 220 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 221 | 221 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $module = CRUDBooster::getCurrentModule(); |
| 231 | 231 | |
| 232 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 232 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 233 | 233 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 234 | 234 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 235 | 235 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | $module = CRUDBooster::getCurrentModule(); |
| 266 | 266 | |
| 267 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 267 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 268 | 268 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 269 | 269 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 270 | 270 | } |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $module = CRUDBooster::getCurrentModule(); |
| 306 | 306 | |
| 307 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 307 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 308 | 308 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 309 | 309 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 310 | 310 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $icon = Request::get('icon'); |
| 315 | 315 | $path = Request::get('path'); |
| 316 | 316 | |
| 317 | - if (! Request::get('id')) { |
|
| 317 | + if (!Request::get('id')) { |
|
| 318 | 318 | |
| 319 | 319 | if (DB::table('cms_moduls')->where('path', $path)->where('deleted_at', null)->count()) { |
| 320 | 320 | return redirect()->back()->with(['message' => 'Sorry the slug has already exists, please choose another !', 'message_type' => 'warning']); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | $module = CRUDBooster::getCurrentModule(); |
| 390 | 390 | |
| 391 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 391 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 392 | 392 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 393 | 393 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 394 | 394 | } |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $script_cols = []; |
| 410 | 410 | foreach ($column as $col) { |
| 411 | 411 | |
| 412 | - if (! $name[$i]) { |
|
| 412 | + if (!$name[$i]) { |
|
| 413 | 413 | $i++; |
| 414 | 414 | continue; |
| 415 | 415 | } |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | $module = CRUDBooster::getCurrentModule(); |
| 466 | 466 | |
| 467 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 467 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 468 | 468 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 469 | 469 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 470 | 470 | } |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | $module = CRUDBooster::getCurrentModule(); |
| 592 | 592 | |
| 593 | - if (! CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 593 | + if (!CRUDBooster::isView() && $this->global_privilege == false) { |
|
| 594 | 594 | CRUDBooster::insertLog(trans('crudbooster.log_try_view', ['module' => $module->name])); |
| 595 | 595 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 596 | 596 | } |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | { |
| 664 | 664 | $this->cbLoader(); |
| 665 | 665 | |
| 666 | - if (! CRUDBooster::isCreate() && $this->global_privilege == false) { |
|
| 666 | + if (!CRUDBooster::isCreate() && $this->global_privilege == false) { |
|
| 667 | 667 | CRUDBooster::insertLog(trans('crudbooster.log_try_add_save', [ |
| 668 | 668 | 'name' => Request::input($this->title_field), |
| 669 | 669 | 'module' => CRUDBooster::getCurrentModule()->name, |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | |
| 763 | 763 | $row = DB::table($this->table)->where($this->primary_key, $id)->first(); |
| 764 | 764 | |
| 765 | - if (! CRUDBooster::isUpdate() && $this->global_privilege == false) { |
|
| 765 | + if (!CRUDBooster::isUpdate() && $this->global_privilege == false) { |
|
| 766 | 766 | CRUDBooster::insertLog(trans("crudbooster.log_try_add", ['name' => $row->{$this->title_field}, 'module' => CRUDBooster::getCurrentModule()->name])); |
| 767 | 767 | CRUDBooster::redirect(CRUDBooster::adminPath(), trans('crudbooster.denied_access')); |
| 768 | 768 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if ($row_api->method_type) { |
| 82 | 82 | $method_type = $row_api->method_type; |
| 83 | 83 | if ($method_type) { |
| 84 | - if (! Request::isMethod($method_type)) { |
|
| 84 | + if (!Request::isMethod($method_type)) { |
|
| 85 | 85 | $result['api_status'] = 0; |
| 86 | 86 | $result['api_message'] = "The requested method is not allowed!"; |
| 87 | 87 | goto show; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | | ---------------------------------------------- |
| 96 | 96 | | |
| 97 | 97 | */ |
| 98 | - if (! $row_api) { |
|
| 98 | + if (!$row_api) { |
|
| 99 | 99 | $result['api_status'] = 0; |
| 100 | 100 | $result['api_message'] = 'Sorry this API endpoint is no longer available or has been changed. Please make sure endpoint is correct.'; |
| 101 | 101 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $used = $param['used']; |
| 126 | 126 | $format_validation = []; |
| 127 | 127 | |
| 128 | - if ($used && ! $required && $value == '') { |
|
| 128 | + if ($used && !$required && $value == '') { |
|
| 129 | 129 | continue; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $format_validation[] = 'file'; |
| 179 | 179 | $input_validator[$name] = Request::file($name); |
| 180 | 180 | } else { |
| 181 | - if (! in_array($type, $type_except)) { |
|
| 181 | + if (!in_array($type, $type_except)) { |
|
| 182 | 182 | $format_validation[] = $type; |
| 183 | 183 | } |
| 184 | 184 | } |
@@ -213,11 +213,11 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | $this->hook_before($posts); |
| 216 | - if($this->output) { |
|
| 216 | + if ($this->output) { |
|
| 217 | 217 | return response()->json($this->output); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - $limit = ($this->limit)?:$posts['limit']; |
|
| 220 | + $limit = ($this->limit) ?: $posts['limit']; |
|
| 221 | 221 | $offset = ($posts['offset']) ?: 0; |
| 222 | 222 | $orderby = ($posts['orderby']) ?: $table.'.'.$pk.',desc'; |
| 223 | 223 | $uploads_format_candidate = explode(',', config("crudbooster.UPLOAD_TYPES")); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | if ($offset) { |
| 236 | 236 | $data->skip($offset); |
| 237 | 237 | } |
| 238 | - if($limit) { |
|
| 238 | + if ($limit) { |
|
| 239 | 239 | $data->take($limit); |
| 240 | 240 | } |
| 241 | 241 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $subquery = $resp['subquery']; |
| 246 | 246 | $used = intval($resp['used']); |
| 247 | 247 | |
| 248 | - if ($used == 0 && ! CRUDBooster::isForeignKey($name)) { |
|
| 248 | + if ($used == 0 && !CRUDBooster::isForeignKey($name)) { |
|
| 249 | 249 | continue; |
| 250 | 250 | } |
| 251 | 251 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $search_in = explode(',', $config); |
| 304 | 304 | |
| 305 | 305 | if ($required == '1') { |
| 306 | - $data->where(function ($w) use ($search_in, $value) { |
|
| 306 | + $data->where(function($w) use ($search_in, $value) { |
|
| 307 | 307 | foreach ($search_in as $k => $field) { |
| 308 | 308 | if ($k == 0) { |
| 309 | 309 | $w->where($field, "like", "%$value%"); |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } else { |
| 316 | 316 | if ($used) { |
| 317 | 317 | if ($value) { |
| 318 | - $data->where(function ($w) use ($search_in, $value) { |
|
| 318 | + $data->where(function($w) use ($search_in, $value) { |
|
| 319 | 319 | foreach ($search_in as $k => $field) { |
| 320 | 320 | if ($k == 0) { |
| 321 | 321 | $w->where($field, "like", "%$value%"); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $data->where($table.'.deleted_at', null); |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | - $data->where(function ($w) use ($parameters, $posts, $table, $type_except) { |
|
| 337 | + $data->where(function($w) use ($parameters, $posts, $table, $type_except) { |
|
| 338 | 338 | foreach ($parameters as $param) { |
| 339 | 339 | $name = $param['name']; |
| 340 | 340 | $type = $param['type']; |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $row->$k = asset($v); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - if (! in_array($k, $responses_fields)) { |
|
| 424 | + if (!in_array($k, $responses_fields)) { |
|
| 425 | 425 | unset($row->$k); |
| 426 | 426 | } |
| 427 | 427 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | |
| 457 | 457 | if ($required) { |
| 458 | 458 | if ($type == 'password') { |
| 459 | - if (! Hash::check($value, $rows->{$name})) { |
|
| 459 | + if (!Hash::check($value, $rows->{$name})) { |
|
| 460 | 460 | $result['api_status'] = 0; |
| 461 | 461 | $result['api_message'] = 'Invalid credentials. Check your username and password.'; |
| 462 | 462 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | } else { |
| 470 | 470 | if ($used) { |
| 471 | 471 | if ($value) { |
| 472 | - if (! Hash::check($value, $row->{$name})) { |
|
| 472 | + if (!Hash::check($value, $row->{$name})) { |
|
| 473 | 473 | $result['api_status'] = 0; |
| 474 | 474 | $result['api_message'] = 'Invalid credentials. Check your username and password.'; |
| 475 | 475 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $rows->$k = asset($v); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | - if (! in_array($k, $responses_fields)) { |
|
| 492 | + if (!in_array($k, $responses_fields)) { |
|
| 493 | 493 | unset($rows->$k); |
| 494 | 494 | } |
| 495 | 495 | } |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | $required = $param['required']; |
| 564 | 564 | $used = $param['used']; |
| 565 | 565 | |
| 566 | - if (! in_array($name, $row_assign_keys)) { |
|
| 566 | + if (!in_array($name, $row_assign_keys)) { |
|
| 567 | 567 | |
| 568 | 568 | continue; |
| 569 | 569 | } |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | //Make sure if saving/updating data additional param included |
| 581 | 581 | $arrkeys = array_keys($row_assign); |
| 582 | 582 | foreach ($posts as $key => $value) { |
| 583 | - if (! in_array($key, $arrkeys)) { |
|
| 583 | + if (!in_array($key, $arrkeys)) { |
|
| 584 | 584 | $row_assign[$key] = $value; |
| 585 | 585 | } |
| 586 | 586 | } |
@@ -588,10 +588,10 @@ discard block |
||
| 588 | 588 | if ($action_type == 'save_add') { |
| 589 | 589 | |
| 590 | 590 | DB::beginTransaction(); |
| 591 | - try{ |
|
| 591 | + try { |
|
| 592 | 592 | $id = DB::table($table)->insertGetId($row_assign); |
| 593 | 593 | DB::commit(); |
| 594 | - }catch (\Exception $e) |
|
| 594 | + } catch (\Exception $e) |
|
| 595 | 595 | { |
| 596 | 596 | DB::rollBack(); |
| 597 | 597 | throw new \Exception($e->getMessage()); |
@@ -658,11 +658,11 @@ discard block |
||
| 658 | 658 | } |
| 659 | 659 | |
| 660 | 660 | $this->hook_after($posts, $result); |
| 661 | - if($this->output) return response()->json($this->output); |
|
| 661 | + if ($this->output) return response()->json($this->output); |
|
| 662 | 662 | |
| 663 | - if($output == 'JSON') { |
|
| 663 | + if ($output == 'JSON') { |
|
| 664 | 664 | return response()->json($result, 200); |
| 665 | - }else{ |
|
| 665 | + } else { |
|
| 666 | 666 | return $result; |
| 667 | 667 | } |
| 668 | 668 | } |