|
@@ 324-334 (lines=11) @@
|
| 321 |
|
return $response; |
| 322 |
|
} |
| 323 |
|
|
| 324 |
|
DB::transaction(function () { |
| 325 |
|
$inserts = $this->prepareInsert($this->updates); |
| 326 |
|
|
| 327 |
|
foreach ($inserts as $column => $value) { |
| 328 |
|
$this->model->setAttribute($column, $value); |
| 329 |
|
} |
| 330 |
|
|
| 331 |
|
$this->model->save(); |
| 332 |
|
|
| 333 |
|
$this->updateRelation($this->relations); |
| 334 |
|
}); |
| 335 |
|
|
| 336 |
|
if (($response = $this->callSaved()) instanceof Response) { |
| 337 |
|
return $response; |
|
@@ 526-537 (lines=12) @@
|
| 523 |
|
return $response; |
| 524 |
|
} |
| 525 |
|
|
| 526 |
|
DB::transaction(function () { |
| 527 |
|
$updates = $this->prepareUpdate($this->updates); |
| 528 |
|
|
| 529 |
|
foreach ($updates as $column => $value) { |
| 530 |
|
/* @var Model $this ->model */ |
| 531 |
|
$this->model->setAttribute($column, $value); |
| 532 |
|
} |
| 533 |
|
|
| 534 |
|
$this->model->save(); |
| 535 |
|
|
| 536 |
|
$this->updateRelation($this->relations); |
| 537 |
|
}); |
| 538 |
|
|
| 539 |
|
if (($result = $this->callSaved()) instanceof Response) { |
| 540 |
|
return $result; |