Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

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