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