|
@@ 322-332 (lines=11) @@
|
| 319 |
|
return $response; |
| 320 |
|
} |
| 321 |
|
|
| 322 |
|
DB::transaction(function () { |
| 323 |
|
$inserts = $this->prepareInsert($this->updates); |
| 324 |
|
|
| 325 |
|
foreach ($inserts as $column => $value) { |
| 326 |
|
$this->model->setAttribute($column, $value); |
| 327 |
|
} |
| 328 |
|
|
| 329 |
|
$this->model->save(); |
| 330 |
|
|
| 331 |
|
$this->updateRelation($this->relations); |
| 332 |
|
}); |
| 333 |
|
|
| 334 |
|
if (($response = $this->callSaved()) instanceof Response) { |
| 335 |
|
return $response; |
|
@@ 513-524 (lines=12) @@
|
| 510 |
|
return $response; |
| 511 |
|
} |
| 512 |
|
|
| 513 |
|
DB::transaction(function () { |
| 514 |
|
$updates = $this->prepareUpdate($this->updates); |
| 515 |
|
|
| 516 |
|
foreach ($updates as $column => $value) { |
| 517 |
|
/* @var Model $this->model */ |
| 518 |
|
$this->model->setAttribute($column, $value); |
| 519 |
|
} |
| 520 |
|
|
| 521 |
|
$this->model->save(); |
| 522 |
|
|
| 523 |
|
$this->updateRelation($this->relations); |
| 524 |
|
}); |
| 525 |
|
|
| 526 |
|
if (($result = $this->callSaved()) instanceof Response) { |
| 527 |
|
return $result; |