@@ 334-344 (lines=11) @@ | ||
331 | return $response; |
|
332 | } |
|
333 | ||
334 | DB::transaction(function () { |
|
335 | $inserts = $this->prepareInsert($this->updates); |
|
336 | ||
337 | foreach ($inserts as $column => $value) { |
|
338 | $this->model->setAttribute($column, $value); |
|
339 | } |
|
340 | ||
341 | $this->model->save(); |
|
342 | ||
343 | $this->updateRelation($this->relations); |
|
344 | }); |
|
345 | ||
346 | if (($response = $this->callSaved()) instanceof Response) { |
|
347 | return $response; |
|
@@ 525-536 (lines=12) @@ | ||
522 | return $response; |
|
523 | } |
|
524 | ||
525 | DB::transaction(function () { |
|
526 | $updates = $this->prepareUpdate($this->updates); |
|
527 | ||
528 | foreach ($updates as $column => $value) { |
|
529 | /* @var Model $this->model */ |
|
530 | $this->model->setAttribute($column, $value); |
|
531 | } |
|
532 | ||
533 | $this->model->save(); |
|
534 | ||
535 | $this->updateRelation($this->relations); |
|
536 | }); |
|
537 | ||
538 | if (($result = $this->callSaved()) instanceof Response) { |
|
539 | return $result; |