Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

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