|
@@ 378-388 (lines=11) @@
|
| 375 |
|
return $response; |
| 376 |
|
} |
| 377 |
|
|
| 378 |
|
DB::transaction(function () { |
| 379 |
|
$inserts = $this->prepareInsert($this->updates); |
| 380 |
|
|
| 381 |
|
foreach ($inserts as $column => $value) { |
| 382 |
|
$this->model->setAttribute($column, $value); |
| 383 |
|
} |
| 384 |
|
|
| 385 |
|
$this->model->save(); |
| 386 |
|
|
| 387 |
|
$this->updateRelation($this->relations); |
| 388 |
|
}); |
| 389 |
|
|
| 390 |
|
if (($response = $this->callSaved()) instanceof Response) { |
| 391 |
|
return $response; |
|
@@ 587-598 (lines=12) @@
|
| 584 |
|
return $response; |
| 585 |
|
} |
| 586 |
|
|
| 587 |
|
DB::transaction(function () { |
| 588 |
|
$updates = $this->prepareUpdate($this->updates); |
| 589 |
|
|
| 590 |
|
foreach ($updates as $column => $value) { |
| 591 |
|
/* @var Model $this->model */ |
| 592 |
|
$this->model->setAttribute($column, $value); |
| 593 |
|
} |
| 594 |
|
|
| 595 |
|
$this->model->save(); |
| 596 |
|
|
| 597 |
|
$this->updateRelation($this->relations); |
| 598 |
|
}); |
| 599 |
|
|
| 600 |
|
if (($result = $this->callSaved()) instanceof Response) { |
| 601 |
|
return $result; |