@@ -14,7 +14,9 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function postUploadFile() |
| 16 | 16 | { |
| 17 | - if(auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
| 17 | + if(auth()->guest()) { |
|
| 18 | + return redirect(cb()->getLoginUrl()); |
|
| 19 | + } |
|
| 18 | 20 | |
| 19 | 21 | $file = null; |
| 20 | 22 | try { |
@@ -14,7 +14,9 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function postUploadImage() |
| 16 | 16 | { |
| 17 | - if(auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
| 17 | + if(auth()->guest()) { |
|
| 18 | + return redirect(cb()->getLoginUrl()); |
|
| 19 | + } |
|
| 18 | 20 | |
| 19 | 21 | $file = null; |
| 20 | 22 | try { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** @var ColumnModel $column */ |
| 50 | 50 | if($data_row) { |
| 51 | 51 | $value = (isset($data_row->{$column->getField()}))?$data_row->{ $column->getField() }:null; |
| 52 | - }else{ |
|
| 52 | + } else{ |
|
| 53 | 53 | $value = request($column->getName()); |
| 54 | 54 | |
| 55 | 55 | if(!$value && $column->getDefaultValue()) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | foreach($column->getValue() as $key=>$val) { |
| 140 | 140 | $data[$key] = $val; |
| 141 | 141 | } |
| 142 | - }else{ |
|
| 142 | + } else{ |
|
| 143 | 143 | $data[$column->getField()] = $column->getValue(); |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->info("== Generating Seeder =="); |
| 37 | 37 | $this->generateSeeder(); |
| 38 | 38 | $this->info("== Finish =="); |
| 39 | - }else{ |
|
| 39 | + } else{ |
|
| 40 | 40 | $this->info("== Importing the seeder =="); |
| 41 | 41 | $this->call("db:seed",["--class"=>"CbMigrationSeeder"]); |
| 42 | 42 | $this->info("== Finish =="); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $composer_path = ''; |
| 92 | 92 | if (file_exists(getcwd().'/composer.phar')) { |
| 93 | 93 | $composer_path = '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
| 94 | - }else{ |
|
| 94 | + } else{ |
|
| 95 | 95 | $composer_path = 'composer'; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | foreach($tables as $table) { |
| 38 | 38 | $this->generate($table); |
| 39 | 39 | } |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | $this->generate($option); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | private function existsPrivilege($cb_roles_id, $cb_menus_id) { |
| 89 | 89 | if($row = cb()->find("cb_role_privileges",['cb_roles_id'=>$cb_roles_id,'cb_menus_id'=>$cb_menus_id])) { |
| 90 | 90 | return $row->id; |
| 91 | - }else{ |
|
| 91 | + } else{ |
|
| 92 | 92 | return null; |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $privilege["can_delete"] = @$access['can_delete']?:0; |
| 112 | 112 | if($privilege_id = $this->existsPrivilege($id, $menus_id)) { |
| 113 | 113 | DB::table("cb_role_privileges")->where("id", $privilege_id)->update($privilege); |
| 114 | - }else{ |
|
| 114 | + } else{ |
|
| 115 | 115 | DB::table("cb_role_privileges")->insert($privilege); |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | foreach($data_options as $key=>$option) { |
| 25 | 25 | if(is_int($key)) { |
| 26 | 26 | $data_options[$option] = $option; |
| 27 | - }else{ |
|
| 27 | + } else{ |
|
| 28 | 28 | $data_options[$key] = $option; |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $data = DB::table($table); |
| 37 | 37 | if($SQLCondition && is_callable($SQLCondition)) { |
| 38 | 38 | $data = call_user_func($SQLCondition, $data); |
| 39 | - }elseif ($SQLCondition && is_string($SQLCondition)) { |
|
| 39 | + } elseif ($SQLCondition && is_string($SQLCondition)) { |
|
| 40 | 40 | $data->whereRaw($SQLCondition); |
| 41 | 41 | } |
| 42 | 42 | $data = $data->get(); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | if($column->getOptionsFromTable()) { |
| 37 | 37 | $option = $column->getOptionsFromTable(); |
| 38 | 38 | return $row->{ $option['table'].'_'.$option['display_field'] }; |
| 39 | - }else{ |
|
| 39 | + } else{ |
|
| 40 | 40 | $option = $column->getOptions(); |
| 41 | 41 | $key = $row->{ $column->getField() }; |
| 42 | 42 | return @$option[ $key ]; |