Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 392-402 (lines=11) @@
389
            return $response;
390
        }
391
392
        DB::transaction(function () {
393
            $inserts = $this->prepareInsert($this->updates);
394
395
            foreach ($inserts as $column => $value) {
396
                $this->model->setAttribute($column, $value);
397
            }
398
399
            $this->model->save();
400
401
            $this->updateRelation($this->relations);
402
        });
403
404
        if (($response = $this->callSaved()) instanceof Response) {
405
            return $response;
@@ 595-606 (lines=12) @@
592
            return $response;
593
        }
594
595
        DB::transaction(function () {
596
            $updates = $this->prepareUpdate($this->updates);
597
598
            foreach ($updates as $column => $value) {
599
                /* @var Model $this->model */
600
                $this->model->setAttribute($column, $value);
601
            }
602
603
            $this->model->save();
604
605
            $this->updateRelation($this->relations);
606
        });
607
608
        if (($result = $this->callSaved()) instanceof Response) {
609
            return $result;