Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 360-370 (lines=11) @@
357
            return $response;
358
        }
359
360
        DB::transaction(function () {
361
            $inserts = $this->prepareInsert($this->updates);
362
363
            foreach ($inserts as $column => $value) {
364
                $this->model->setAttribute($column, $value);
365
            }
366
367
            $this->model->save();
368
369
            $this->updateRelation($this->relations);
370
        });
371
372
        if (($response = $this->callSaved()) instanceof Response) {
373
            return $response;
@@ 563-574 (lines=12) @@
560
            return $response;
561
        }
562
563
        DB::transaction(function () {
564
            $updates = $this->prepareUpdate($this->updates);
565
566
            foreach ($updates as $column => $value) {
567
                /* @var Model $this->model */
568
                $this->model->setAttribute($column, $value);
569
            }
570
571
            $this->model->save();
572
573
            $this->updateRelation($this->relations);
574
        });
575
576
        if (($result = $this->callSaved()) instanceof Response) {
577
            return $result;