@@ -37,7 +37,7 @@ |
||
37 | 37 | $fullKey = $relation->getQualifiedRelatedPivotKeyName(); |
38 | 38 | $fullKeyArray = explode('.', $fullKey); |
39 | 39 | |
40 | - return $this->otherKey = 'pivot.' . end($fullKeyArray); |
|
40 | + return $this->otherKey = 'pivot.'.end($fullKeyArray); |
|
41 | 41 | } |
42 | 42 | else if ($relation instanceof HasManyRelation) { |
43 | 43 | /* @var HasManyRelation $relation */ |
@@ -38,8 +38,7 @@ |
||
38 | 38 | $fullKeyArray = explode('.', $fullKey); |
39 | 39 | |
40 | 40 | return $this->otherKey = 'pivot.' . end($fullKeyArray); |
41 | - } |
|
42 | - else if ($relation instanceof HasManyRelation) { |
|
41 | + } else if ($relation instanceof HasManyRelation) { |
|
43 | 42 | /* @var HasManyRelation $relation */ |
44 | 43 | return $this->otherKey = $relation->getRelated()->getKeyName(); |
45 | 44 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | return $ret; |
254 | 254 | } |
255 | 255 | |
256 | - collect(explode(',', $id))->filter()->each(function ($id) { |
|
256 | + collect(explode(',', $id))->filter()->each(function($id) { |
|
257 | 257 | $builder = $this->model()->newQuery(); |
258 | 258 | |
259 | 259 | if ($this->isSoftDeletes) { |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | |
307 | 307 | $data = $model->toArray(); |
308 | 308 | |
309 | - $this->fields()->filter(function ($field) { |
|
309 | + $this->fields()->filter(function($field) { |
|
310 | 310 | return $field instanceof Field\File; |
311 | - })->each(function (Field\File $file) use ($data) { |
|
311 | + })->each(function(Field\File $file) use ($data) { |
|
312 | 312 | $file->setOriginal($data); |
313 | 313 | |
314 | 314 | $file->destroy(); |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | return $response; |
334 | 334 | } |
335 | 335 | |
336 | - DB::transaction(function () { |
|
336 | + DB::transaction(function() { |
|
337 | 337 | $inserts = $this->prepareInsert($this->updates); |
338 | 338 | |
339 | 339 | foreach ($inserts as $column => $value) { |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | return $response; |
538 | 538 | } |
539 | 539 | |
540 | - DB::transaction(function () { |
|
540 | + DB::transaction(function() { |
|
541 | 541 | $updates = $this->prepareUpdate($this->updates); |
542 | 542 | |
543 | 543 | foreach ($updates as $column => $value) { |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | $foreignKeyName = $relation->getForeignKeyName(); |
833 | 833 | $localKeyName = $relation->getLocalKeyName(); |
834 | 834 | |
835 | - foreach($relation->get() as $child) { |
|
835 | + foreach ($relation->get() as $child) { |
|
836 | 836 | if (($ind = array_search($child->getKey(), $data)) !== false) { |
837 | 837 | unset($data[$ind]); |
838 | 838 | } else { |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | protected function getFieldByColumn($column) |
1014 | 1014 | { |
1015 | 1015 | return $this->fields()->first( |
1016 | - function (Field $field) use ($column) { |
|
1016 | + function(Field $field) use ($column) { |
|
1017 | 1017 | if (is_array($field->column())) { |
1018 | 1018 | return in_array($column, $field->column()); |
1019 | 1019 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | { |
1033 | 1033 | $values = $this->model->toArray(); |
1034 | 1034 | |
1035 | - $this->fields()->each(function (Field $field) use ($values) { |
|
1035 | + $this->fields()->each(function(Field $field) use ($values) { |
|
1036 | 1036 | $field->setOriginal($values); |
1037 | 1037 | }); |
1038 | 1038 | } |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | { |
1047 | 1047 | $relations = $this->getRelations(); |
1048 | 1048 | |
1049 | - $this->fields()->each(function (Field $field) use ($relations) { |
|
1049 | + $this->fields()->each(function(Field $field) use ($relations) { |
|
1050 | 1050 | if ($field->getSnakeAttributes()) { |
1051 | 1051 | return; |
1052 | 1052 | } |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | |
1089 | 1089 | $data = $this->model->toArray(); |
1090 | 1090 | |
1091 | - $this->fields()->each(function (Field $field) use ($data) { |
|
1091 | + $this->fields()->each(function(Field $field) use ($data) { |
|
1092 | 1092 | if (!in_array($field->column(), $this->ignored, true)) { |
1093 | 1093 | $field->fill($data); |
1094 | 1094 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | */ |
1220 | 1220 | public function setWidth($fieldWidth = 8, $labelWidth = 2): self |
1221 | 1221 | { |
1222 | - $this->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1222 | + $this->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1223 | 1223 | /* @var Field $field */ |
1224 | 1224 | $field->setWidth($fieldWidth, $labelWidth); |
1225 | 1225 | }); |