Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 536-547 (lines=12) @@
533
            return $response;
534
        }
535
536
        DB::transaction(function () {
537
            $updates = $this->prepareUpdate($this->updates);
538
539
            foreach ($updates as $column => $value) {
540
                /* @var Model $this->model */
541
                $this->model->setAttribute($column, $value);
542
            }
543
544
            $this->model->save();
545
546
            $this->updateRelation($this->relations);
547
        });
548
549
        if (($result = $this->callSaved()) instanceof Response) {
550
            return $result;
@@ 385-395 (lines=11) @@
382
            return $response;
383
        }
384
385
        DB::transaction(function () {
386
            $inserts = $this->prepareInsert($this->updates);
387
388
            foreach ($inserts as $column => $value) {
389
                $this->model->setAttribute($column, $value);
390
            }
391
392
            $this->model->save();
393
394
            $this->updateRelation($this->relations);
395
        });
396
397
        if (($response = $this->callSaved()) instanceof Response) {
398
            return $response;