Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

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