We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 89-103 (lines=15) @@ | ||
| 86 | ||
| 87 | ||
| 88 | ||
| 89 | public function syncPivot($model, $data) |
|
| 90 | { |
|
| 91 | foreach ($this->relations as $key => $relation) |
|
| 92 | { |
|
| 93 | if ($relation['pivot']){ |
|
| 94 | $model->{$relation['name']}()->sync($data[$key]); |
|
| 95 | ||
| 96 | foreach($relation['pivotFields'] as $pivotField){ |
|
| 97 | foreach($data[$pivotField] as $pivot_id => $field){ |
|
| 98 | $model->{$relation['name']}()->updateExistingPivot($pivot_id, [$pivotField => $field]); |
|
| 99 | } |
|
| 100 | } |
|
| 101 | } |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| 105 | ||
| 106 | ||
| @@ 536-550 (lines=15) @@ | ||
| 533 | return $this->{$items}; |
|
| 534 | } |
|
| 535 | ||
| 536 | private function syncPivot($model, $data) |
|
| 537 | { |
|
| 538 | foreach ($this->relations as $key => $relation) |
|
| 539 | { |
|
| 540 | if ($relation['pivot']){ |
|
| 541 | $model->{$relation['name']}()->sync($data[$key]); |
|
| 542 | ||
| 543 | foreach($relation['pivotFields'] as $pivotField){ |
|
| 544 | foreach($data[$pivotField] as $pivot_id => $field){ |
|
| 545 | $model->{$relation['name']}()->updateExistingPivot($pivot_id, [$pivotField => $field]); |
|
| 546 | } |
|
| 547 | } |
|
| 548 | } |
|
| 549 | } |
|
| 550 | } |
|
| 551 | ||
| 552 | private function getRelationValues($model, $field, $where = [], $order = []) |
|
| 553 | { |
|