Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 388-398 (lines=11) @@
385
            return $response;
386
        }
387
388
        DB::transaction(function () {
389
            $inserts = $this->prepareInsert($this->updates);
390
391
            foreach ($inserts as $column => $value) {
392
                $this->model->setAttribute($column, $value);
393
            }
394
395
            $this->model->save();
396
397
            $this->updateRelation($this->relations);
398
        });
399
400
        if (($response = $this->callSaved()) instanceof Response) {
401
            return $response;
@@ 557-568 (lines=12) @@
554
            return $response;
555
        }
556
557
        DB::transaction(function () {
558
            $updates = $this->prepareUpdate($this->updates);
559
560
            foreach ($updates as $column => $value) {
561
                /* @var Model $this->model */
562
                $this->model->setAttribute($column, $value);
563
            }
564
565
            $this->model->save();
566
567
            $this->updateRelation($this->relations);
568
        });
569
570
        if (($result = $this->callSaved()) instanceof Response) {
571
            return $result;