@@ 540-551 (lines=12) @@ | ||
537 | return $response; |
|
538 | } |
|
539 | ||
540 | DB::transaction(function () { |
|
541 | $updates = $this->prepareUpdate($this->updates); |
|
542 | ||
543 | foreach ($updates as $column => $value) { |
|
544 | /* @var Model $this ->model */ |
|
545 | $this->model->setAttribute($column, $value); |
|
546 | } |
|
547 | ||
548 | $this->model->save(); |
|
549 | ||
550 | $this->updateRelation($this->relations); |
|
551 | }); |
|
552 | ||
553 | if (($result = $this->callSaved()) instanceof Response) { |
|
554 | return $result; |
|
@@ 336-346 (lines=11) @@ | ||
333 | return $response; |
|
334 | } |
|
335 | ||
336 | DB::transaction(function () { |
|
337 | $inserts = $this->prepareInsert($this->updates); |
|
338 | ||
339 | foreach ($inserts as $column => $value) { |
|
340 | $this->model->setAttribute($column, $value); |
|
341 | } |
|
342 | ||
343 | $this->model->save(); |
|
344 | ||
345 | $this->updateRelation($this->relations); |
|
346 | }); |
|
347 | ||
348 | if (($response = $this->callSaved()) instanceof Response) { |
|
349 | return $response; |