@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | $data = new TextModel(); |
| 60 | 60 | $data = $this->setDefaultModelValue($data); |
| 61 | 61 | $data->setLabel($label); |
| 62 | - $data->setName($this->name($label,$name)); |
|
| 63 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 62 | + $data->setName($this->name($label, $name)); |
|
| 63 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 64 | 64 | $data->setType("text"); |
| 65 | 65 | |
| 66 | 66 | columnSingleton()->setColumn($this->index, $data); |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | $data = new CheckboxModel(); |
| 76 | 76 | $data = $this->setDefaultModelValue($data); |
| 77 | 77 | $data->setLabel($label); |
| 78 | - $data->setName($this->name($label,$name)); |
|
| 79 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 78 | + $data->setName($this->name($label, $name)); |
|
| 79 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 80 | 80 | $data->setType("checkbox"); |
| 81 | 81 | |
| 82 | 82 | columnSingleton()->setColumn($this->index, $data); |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | $data = new PasswordModel(); |
| 92 | 92 | $data = $this->setDefaultModelValue($data); |
| 93 | 93 | $data->setLabel($label); |
| 94 | - $data->setName($this->name($label,$name)); |
|
| 95 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 94 | + $data->setName($this->name($label, $name)); |
|
| 95 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 96 | 96 | $data->setType("password"); |
| 97 | 97 | $data->setShowDetail(false); |
| 98 | 98 | $data->setShowIndex(false); |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | $data = new ImageModel(); |
| 110 | 110 | $data = $this->setDefaultModelValue($data); |
| 111 | 111 | $data->setLabel($label); |
| 112 | - $data->setName($this->name($label,$name)); |
|
| 113 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 112 | + $data->setName($this->name($label, $name)); |
|
| 113 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 114 | 114 | $data->setType("image"); |
| 115 | 115 | |
| 116 | 116 | columnSingleton()->setColumn($this->index, $data); |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | $data = new TextAreaModel(); |
| 126 | 126 | $data = $this->setDefaultModelValue($data); |
| 127 | 127 | $data->setLabel($label); |
| 128 | - $data->setName($this->name($label,$name)); |
|
| 129 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 128 | + $data->setName($this->name($label, $name)); |
|
| 129 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 130 | 130 | $data->setType("text_area"); |
| 131 | 131 | |
| 132 | 132 | columnSingleton()->setColumn($this->index, $data); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $data = new SelectTableModel(); |
| 142 | 142 | $data = $this->setDefaultModelValue($data); |
| 143 | 143 | $data->setLabel($label); |
| 144 | - $data->setName($this->name($label,$name)); |
|
| 144 | + $data->setName($this->name($label, $name)); |
|
| 145 | 145 | $data->setField($this->name($label, $name)); |
| 146 | 146 | $data->setType("select_table"); |
| 147 | 147 | |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | $selectTable = new SelectTable($this->index); |
| 151 | 151 | |
| 152 | - if($selectConfig) { |
|
| 153 | - $selectTable->optionsFromTable($selectConfig['table'],$selectConfig['value_option'],$selectConfig['display_option'],@$selectConfig['sql_condition']); |
|
| 152 | + if ($selectConfig) { |
|
| 153 | + $selectTable->optionsFromTable($selectConfig['table'], $selectConfig['value_option'], $selectConfig['display_option'], @$selectConfig['sql_condition']); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | return $selectTable; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $data = new SelectOptionModel(); |
| 164 | 164 | $data = $this->setDefaultModelValue($data); |
| 165 | 165 | $data->setLabel($label); |
| 166 | - $data->setName($this->name($label,$name)); |
|
| 166 | + $data->setName($this->name($label, $name)); |
|
| 167 | 167 | $data->setField($this->name($label, $name)); |
| 168 | 168 | $data->setType("select_option"); |
| 169 | 169 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $selectOption = new SelectOption($this->index); |
| 173 | 173 | |
| 174 | - if($options) { |
|
| 174 | + if ($options) { |
|
| 175 | 175 | $selectOption->options($options); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -191,15 +191,15 @@ discard block |
||
| 191 | 191 | $data = new SelectQueryModel(); |
| 192 | 192 | $data = $this->setDefaultModelValue($data); |
| 193 | 193 | $data->setLabel($label); |
| 194 | - $data->setName($this->name($label,$name)); |
|
| 194 | + $data->setName($this->name($label, $name)); |
|
| 195 | 195 | $data->setField($this->name($label, $name)); |
| 196 | 196 | $data->setType("select_query"); |
| 197 | 197 | |
| 198 | 198 | columnSingleton()->setColumn($this->index, $data); |
| 199 | 199 | |
| 200 | - $selectQuery =new SelectQuery($this->index); |
|
| 200 | + $selectQuery = new SelectQuery($this->index); |
|
| 201 | 201 | |
| 202 | - if($query) { |
|
| 202 | + if ($query) { |
|
| 203 | 203 | $selectQuery->optionsFromQuery($query); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -214,8 +214,8 @@ discard block |
||
| 214 | 214 | $data = new CustomModel(); |
| 215 | 215 | $data = $this->setDefaultModelValue($data); |
| 216 | 216 | $data->setLabel($label); |
| 217 | - $data->setName($this->name($label,$name)); |
|
| 218 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 217 | + $data->setName($this->name($label, $name)); |
|
| 218 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 219 | 219 | $data->setType("custom"); |
| 220 | 220 | |
| 221 | 221 | columnSingleton()->setColumn($this->index, $data); |
@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | $data = new DateModel(); |
| 231 | 231 | $data = $this->setDefaultModelValue($data); |
| 232 | 232 | $data->setLabel($label); |
| 233 | - $data->setName($this->name($label,$name)); |
|
| 234 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 233 | + $data->setName($this->name($label, $name)); |
|
| 234 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 235 | 235 | $data->setType("date"); |
| 236 | 236 | |
| 237 | 237 | columnSingleton()->setColumn($this->index, $data); |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | $data = new DatetimeModel(); |
| 247 | 247 | $data = $this->setDefaultModelValue($data); |
| 248 | 248 | $data->setLabel($label); |
| 249 | - $data->setName($this->name($label,$name)); |
|
| 250 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 249 | + $data->setName($this->name($label, $name)); |
|
| 250 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 251 | 251 | $data->setType("datetime"); |
| 252 | 252 | |
| 253 | 253 | columnSingleton()->setColumn($this->index, $data); |
@@ -262,8 +262,8 @@ discard block |
||
| 262 | 262 | $data = new EmailModel(); |
| 263 | 263 | $data = $this->setDefaultModelValue($data); |
| 264 | 264 | $data->setLabel($label); |
| 265 | - $data->setName($this->name($label,$name)); |
|
| 266 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 265 | + $data->setName($this->name($label, $name)); |
|
| 266 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 267 | 267 | $data->setType("email"); |
| 268 | 268 | |
| 269 | 269 | columnSingleton()->setColumn($this->index, $data); |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | $data = new FileModel(); |
| 279 | 279 | $data = $this->setDefaultModelValue($data); |
| 280 | 280 | $data->setLabel($label); |
| 281 | - $data->setName($this->name($label,$name)); |
|
| 282 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 281 | + $data->setName($this->name($label, $name)); |
|
| 282 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 283 | 283 | $data->setType("file"); |
| 284 | 284 | |
| 285 | 285 | columnSingleton()->setColumn($this->index, $data); |
@@ -295,8 +295,8 @@ discard block |
||
| 295 | 295 | $data = new HiddenModel(); |
| 296 | 296 | $data = $this->setDefaultModelValue($data); |
| 297 | 297 | $data->setLabel($label); |
| 298 | - $data->setName($this->name($label,$name)); |
|
| 299 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 298 | + $data->setName($this->name($label, $name)); |
|
| 299 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 300 | 300 | $data->setType("hidden"); |
| 301 | 301 | |
| 302 | 302 | columnSingleton()->setColumn($this->index, $data); |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | $data = new NumberModel(); |
| 312 | 312 | $data = $this->setDefaultModelValue($data); |
| 313 | 313 | $data->setLabel($label); |
| 314 | - $data->setName($this->name($label,$name)); |
|
| 315 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 314 | + $data->setName($this->name($label, $name)); |
|
| 315 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 316 | 316 | $data->setType("number"); |
| 317 | 317 | |
| 318 | 318 | columnSingleton()->setColumn($this->index, $data); |
@@ -327,8 +327,8 @@ discard block |
||
| 327 | 327 | $data = new MoneyModel(); |
| 328 | 328 | $data = $this->setDefaultModelValue($data); |
| 329 | 329 | $data->setLabel($label); |
| 330 | - $data->setName($this->name($label,$name)); |
|
| 331 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 330 | + $data->setName($this->name($label, $name)); |
|
| 331 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 332 | 332 | $data->setType("money"); |
| 333 | 333 | |
| 334 | 334 | columnSingleton()->setColumn($this->index, $data); |
@@ -343,8 +343,8 @@ discard block |
||
| 343 | 343 | $data = new RadioModel(); |
| 344 | 344 | $data = $this->setDefaultModelValue($data); |
| 345 | 345 | $data->setLabel($label); |
| 346 | - $data->setName($this->name($label,$name)); |
|
| 347 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 346 | + $data->setName($this->name($label, $name)); |
|
| 347 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 348 | 348 | $data->setType("radio"); |
| 349 | 349 | |
| 350 | 350 | columnSingleton()->setColumn($this->index, $data); |
@@ -359,8 +359,8 @@ discard block |
||
| 359 | 359 | $data = new WysiwygModel(); |
| 360 | 360 | $data = $this->setDefaultModelValue($data); |
| 361 | 361 | $data->setLabel($label); |
| 362 | - $data->setName($this->name($label,$name)); |
|
| 363 | - $data->setField($field_to_save?:$this->name($label, $name)); |
|
| 362 | + $data->setName($this->name($label, $name)); |
|
| 363 | + $data->setField($field_to_save ?: $this->name($label, $name)); |
|
| 364 | 364 | $data->setType("wysiwyg"); |
| 365 | 365 | |
| 366 | 366 | columnSingleton()->setColumn($this->index, $data); |
@@ -23,16 +23,16 @@ |
||
| 23 | 23 | |
| 24 | 24 | public function create() |
| 25 | 25 | { |
| 26 | - if($this->command->) |
|
| 27 | - if($this->command->option("password") == "AUTO") { |
|
| 26 | + if ($this->command->) |
|
| 27 | + if ($this->command->option("password") == "AUTO") { |
|
| 28 | 28 | $password = Str::random(16); |
| 29 | - }else{ |
|
| 29 | + } else { |
|
| 30 | 30 | $password = $this->command->option("password"); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if($this->command->option("username") == "AUTO") { |
|
| 33 | + if ($this->command->option("username") == "AUTO") { |
|
| 34 | 34 | $username = Str::random(5); |
| 35 | - }else{ |
|
| 35 | + } else { |
|
| 36 | 36 | $username = $this->command->option("username"); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -23,16 +23,17 @@ |
||
| 23 | 23 | |
| 24 | 24 | public function create() |
| 25 | 25 | { |
| 26 | - if($this->command->) |
|
| 27 | - if($this->command->option("password") == "AUTO") { |
|
| 26 | + if($this->command->) { |
|
| 27 | + if($this->command->option("password") == "AUTO") { |
|
| 28 | 28 | $password = Str::random(16); |
| 29 | - }else{ |
|
| 29 | + } |
|
| 30 | + } else{ |
|
| 30 | 31 | $password = $this->command->option("password"); |
| 31 | 32 | } |
| 32 | 33 | |
| 33 | 34 | if($this->command->option("username") == "AUTO") { |
| 34 | 35 | $username = Str::random(5); |
| 35 | - }else{ |
|
| 36 | + } else{ |
|
| 36 | 37 | $username = $this->command->option("username"); |
| 37 | 38 | } |
| 38 | 39 | |
@@ -21,10 +21,10 @@ |
||
| 21 | 21 | public function options($data_options) { |
| 22 | 22 | $data = columnSingleton()->getColumn($this->index); |
| 23 | 23 | |
| 24 | - foreach($data_options as $key=>$option) { |
|
| 25 | - if(is_int($key)) { |
|
| 24 | + foreach ($data_options as $key=>$option) { |
|
| 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 | } |
@@ -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 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | name="{{ $column->getName() }}" id="{{ $column->getName() }}"> |
| 8 | 8 | <option value="">** Select a {{ $column->getLabel() }}</option> |
| 9 | 9 | <?php |
| 10 | - $columnValue = old($column->getName())?:($column->getDefaultValue())?:$column->getValue(); |
|
| 10 | + $columnValue = old($column->getName()) ?: ($column->getDefaultValue()) ?: $column->getValue(); |
|
| 11 | 11 | ?> |
| 12 | 12 | @foreach($column->getOptions() as $key=>$value) |
| 13 | 13 | <option {{ $columnValue==$key?'selected':'' }} value="{{ $key }}">{{ $value }}</option> |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | $option = $column->getOptions(); |
| 23 | 23 | $key = $row->{ $column->getField() }; |
| 24 | - return @$option[ $key ]; |
|
| 24 | + return @$option[$key]; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function detailRender($row, $column) |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -cb()->routeGroupBackend(function () { |
|
| 4 | - cb()->routePost("select-table-lookup",'\crocodicstudio\crudbooster\types\select_table\SelectTableController@postLookup'); |
|
| 3 | +cb()->routeGroupBackend(function() { |
|
| 4 | + cb()->routePost("select-table-lookup", '\crocodicstudio\crudbooster\types\select_table\SelectTableController@postLookup'); |
|
| 5 | 5 | }); |
| 6 | 6 | \ No newline at end of file |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | <option value="">** Select a {{ $column->getLabel() }}</option> |
| 9 | 9 | @if(!$column->getForeignKey()) |
| 10 | 10 | <?php |
| 11 | - $columnValue = old($column->getName())?:($column->getDefaultValue())?:$column->getValue(); |
|
| 11 | + $columnValue = old($column->getName()) ?: ($column->getDefaultValue()) ?: $column->getValue(); |
|
| 12 | 12 | ?> |
| 13 | 13 | @foreach($column->getOptions() as $key=>$value) |
| 14 | 14 | <option {{ $columnValue==$key?'selected':'' }} value="{{ $key }}">{{ $value }}</option> |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function optionsFromTable($table, $value_option, $display_option, $SQLCondition = null) { |
| 43 | 43 | |
| 44 | - if(strpos($table,"App\Models")!==false) { |
|
| 44 | + if (strpos($table, "App\Models") !== false) { |
|
| 45 | 45 | $table = new $table(); |
| 46 | 46 | $table = $table::$tableName; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $data = DB::table($table); |
| 50 | - if($SQLCondition && is_callable($SQLCondition)) { |
|
| 50 | + if ($SQLCondition && is_callable($SQLCondition)) { |
|
| 51 | 51 | $data = call_user_func($SQLCondition, $data); |
| 52 | 52 | }elseif ($SQLCondition && is_string($SQLCondition)) { |
| 53 | 53 | $data->whereRaw($SQLCondition); |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | $data = $data->get(); |
| 56 | 56 | $options = []; |
| 57 | 57 | foreach ($data as $d) { |
| 58 | - $options[ $d->$value_option ] = $d->$display_option; |
|
| 58 | + $options[$d->$value_option] = $d->$display_option; |
|
| 59 | 59 | } |
| 60 | 60 | $data = columnSingleton()->getColumn($this->index); |
| 61 | 61 | /** @var $data SelectTableModel */ |
| 62 | - $data->setOptionsFromTable(["table"=>$table,"key_field"=>$value_option,"display_field"=>$display_option,"sql_condition"=>$SQLCondition]); |
|
| 62 | + $data->setOptionsFromTable(["table"=>$table, "key_field"=>$value_option, "display_field"=>$display_option, "sql_condition"=>$SQLCondition]); |
|
| 63 | 63 | columnSingleton()->setColumn($this->index, $data); |
| 64 | 64 | |
| 65 | 65 | $this->options($options); |
@@ -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(); |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function query($query, $column) |
| 21 | 21 | { |
| 22 | - if($column->getOptionsFromTable()) { |
|
| 22 | + if ($column->getOptionsFromTable()) { |
|
| 23 | 23 | $option = $column->getOptionsFromTable(); |
| 24 | - $query->leftjoin($option["table"],$option["table"].'.'.$option["key_field"],"=", $column->getName()); |
|
| 24 | + $query->leftjoin($option["table"], $option["table"].'.'.$option["key_field"], "=", $column->getName()); |
|
| 25 | 25 | $query->addSelect($option['table'].'.'.$option['display_field'].' as '.$option['table'].'_'.$option['display_field']); |
| 26 | 26 | } |
| 27 | 27 | return $query; |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function indexRender($row, $column) |
| 35 | 35 | { |
| 36 | - if($column->getOptionsFromTable()) { |
|
| 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 | - return @$option[ $key ]; |
|
| 42 | + return @$option[$key]; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
@@ -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 ]; |