@@ 341-351 (lines=11) @@ | ||
338 | return $response; |
|
339 | } |
|
340 | ||
341 | DB::transaction(function () { |
|
342 | $inserts = $this->prepareInsert($this->updates); |
|
343 | ||
344 | foreach ($inserts as $column => $value) { |
|
345 | $this->model->setAttribute($column, $value); |
|
346 | } |
|
347 | ||
348 | $this->model->save(); |
|
349 | ||
350 | $this->updateRelation($this->relations); |
|
351 | }); |
|
352 | ||
353 | if (($response = $this->callSaved()) instanceof Response) { |
|
354 | return $response; |
|
@@ 532-543 (lines=12) @@ | ||
529 | return $response; |
|
530 | } |
|
531 | ||
532 | DB::transaction(function () { |
|
533 | $updates = $this->prepareUpdate($this->updates); |
|
534 | ||
535 | foreach ($updates as $column => $value) { |
|
536 | /* @var Model $this->model */ |
|
537 | $this->model->setAttribute($column, $value); |
|
538 | } |
|
539 | ||
540 | $this->model->save(); |
|
541 | ||
542 | $this->updateRelation($this->relations); |
|
543 | }); |
|
544 | ||
545 | if (($result = $this->callSaved()) instanceof Response) { |
|
546 | return $result; |