|
@@ 327-337 (lines=11) @@
|
| 324 |
|
return $response; |
| 325 |
|
} |
| 326 |
|
|
| 327 |
|
DB::transaction(function () { |
| 328 |
|
$inserts = $this->prepareInsert($this->updates); |
| 329 |
|
|
| 330 |
|
foreach ($inserts as $column => $value) { |
| 331 |
|
$this->model->setAttribute($column, $value); |
| 332 |
|
} |
| 333 |
|
|
| 334 |
|
$this->model->save(); |
| 335 |
|
|
| 336 |
|
$this->updateRelation($this->relations); |
| 337 |
|
}); |
| 338 |
|
|
| 339 |
|
if (($response = $this->callSaved()) instanceof Response) { |
| 340 |
|
return $response; |
|
@@ 518-529 (lines=12) @@
|
| 515 |
|
return $response; |
| 516 |
|
} |
| 517 |
|
|
| 518 |
|
DB::transaction(function () { |
| 519 |
|
$updates = $this->prepareUpdate($this->updates); |
| 520 |
|
|
| 521 |
|
foreach ($updates as $column => $value) { |
| 522 |
|
/* @var Model $this->model */ |
| 523 |
|
$this->model->setAttribute($column, $value); |
| 524 |
|
} |
| 525 |
|
|
| 526 |
|
$this->model->save(); |
| 527 |
|
|
| 528 |
|
$this->updateRelation($this->relations); |
| 529 |
|
}); |
| 530 |
|
|
| 531 |
|
if (($result = $this->callSaved()) instanceof Response) { |
| 532 |
|
return $result; |