Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 537-548 (lines=12) @@
534
            return $response;
535
        }
536
537
        DB::transaction(function () {
538
            $updates = $this->prepareUpdate($this->updates);
539
540
            foreach ($updates as $column => $value) {
541
                /* @var Model $this->model */
542
                $this->model->setAttribute($column, $value);
543
            }
544
545
            $this->model->save();
546
547
            $this->updateRelation($this->relations);
548
        });
549
550
        if (($result = $this->callSaved()) instanceof Response) {
551
            return $result;
@@ 386-396 (lines=11) @@
383
            return $response;
384
        }
385
386
        DB::transaction(function () {
387
            $inserts = $this->prepareInsert($this->updates);
388
389
            foreach ($inserts as $column => $value) {
390
                $this->model->setAttribute($column, $value);
391
            }
392
393
            $this->model->save();
394
395
            $this->updateRelation($this->relations);
396
        });
397
398
        if (($response = $this->callSaved()) instanceof Response) {
399
            return $response;