Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

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