Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 334-344 (lines=11) @@
331
            return $response;
332
        }
333
334
        DB::transaction(function () {
335
            $inserts = $this->prepareInsert($this->updates);
336
337
            foreach ($inserts as $column => $value) {
338
                $this->model->setAttribute($column, $value);
339
            }
340
341
            $this->model->save();
342
343
            $this->updateRelation($this->relations);
344
        });
345
346
        if (($response = $this->callSaved()) instanceof Response) {
347
            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;