Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 459-469 (lines=11) @@
456
            return $response;
457
        }
458
459
        DB::transaction(function () {
460
            $inserts = $this->prepareInsert($this->updates);
461
462
            foreach ($inserts as $column => $value) {
463
                $this->model->setAttribute($column, $value);
464
            }
465
466
            $this->model->save();
467
468
            $this->updateRelation($this->relations);
469
        });
470
471
        if (($response = $this->callSaved()) instanceof Response) {
472
            return $response;
@@ 629-640 (lines=12) @@
626
            return $response;
627
        }
628
629
        DB::transaction(function () {
630
            $updates = $this->prepareUpdate($this->updates);
631
632
            foreach ($updates as $column => $value) {
633
                /* @var Model $this->model */
634
                $this->model->setAttribute($column, $value);
635
            }
636
637
            $this->model->save();
638
639
            $this->updateRelation($this->relations);
640
        });
641
642
        if (($result = $this->callSaved()) instanceof Response) {
643
            return $result;