Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 341-351 (lines=11) @@
338
            return $response;
339
        }
340
341
        DB::transaction(function () {
342
            $inserts = $this->prepareInsert($this->updates);
343
344
            foreach ($inserts as $column => $value) {
345
                $this->model->setAttribute($column, $value);
346
            }
347
348
            $this->model->save();
349
350
            $this->updateRelation($this->relations);
351
        });
352
353
        if (($response = $this->callSaved()) instanceof Response) {
354
            return $response;
@@ 544-555 (lines=12) @@
541
            return $response;
542
        }
543
544
        DB::transaction(function () {
545
            $updates = $this->prepareUpdate($this->updates);
546
547
            foreach ($updates as $column => $value) {
548
                /* @var Model $this->model */
549
                $this->model->setAttribute($column, $value);
550
            }
551
552
            $this->model->save();
553
554
            $this->updateRelation($this->relations);
555
        });
556
557
        if (($result = $this->callSaved()) instanceof Response) {
558
            return $result;