|
@@ 364-374 (lines=11) @@
|
| 361 |
|
return $response; |
| 362 |
|
} |
| 363 |
|
|
| 364 |
|
DB::transaction(function () { |
| 365 |
|
$inserts = $this->prepareInsert($this->updates); |
| 366 |
|
|
| 367 |
|
foreach ($inserts as $column => $value) { |
| 368 |
|
$this->model->setAttribute($column, $value); |
| 369 |
|
} |
| 370 |
|
|
| 371 |
|
$this->model->save(); |
| 372 |
|
|
| 373 |
|
$this->updateRelation($this->relations); |
| 374 |
|
}); |
| 375 |
|
|
| 376 |
|
if (($response = $this->callSaved()) instanceof Response) { |
| 377 |
|
return $response; |
|
@@ 567-578 (lines=12) @@
|
| 564 |
|
return $response; |
| 565 |
|
} |
| 566 |
|
|
| 567 |
|
DB::transaction(function () { |
| 568 |
|
$updates = $this->prepareUpdate($this->updates); |
| 569 |
|
|
| 570 |
|
foreach ($updates as $column => $value) { |
| 571 |
|
/* @var Model $this->model */ |
| 572 |
|
$this->model->setAttribute($column, $value); |
| 573 |
|
} |
| 574 |
|
|
| 575 |
|
$this->model->save(); |
| 576 |
|
|
| 577 |
|
$this->updateRelation($this->relations); |
| 578 |
|
}); |
| 579 |
|
//Disable Pjax otherwise it would cause the show() method to be called before redirecting |
| 580 |
|
if (request()->pjax()) { |
| 581 |
|
request()->headers->set('X-PJAX', false); |