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;
@@ 628-639 (lines=12) @@
625
            return $response;
626
        }
627
628
        DB::transaction(function () {
629
            $updates = $this->prepareUpdate($this->updates);
630
631
            foreach ($updates as $column => $value) {
632
                /* @var Model $this->model */
633
                $this->model->setAttribute($column, $value);
634
            }
635
636
            $this->model->save();
637
638
            $this->updateRelation($this->relations);
639
        });
640
641
        if (($result = $this->callSaved()) instanceof Response) {
642
            return $result;