Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 337-347 (lines=11) @@
334
            return $response;
335
        }
336
337
        DB::transaction(function () {
338
            $inserts = $this->prepareInsert($this->updates);
339
340
            foreach ($inserts as $column => $value) {
341
                $this->model->setAttribute($column, $value);
342
            }
343
344
            $this->model->save();
345
346
            $this->updateRelation($this->relations);
347
        });
348
349
        if (($response = $this->complete($this->saved)) instanceof Response) {
350
            return $response;
@@ 524-535 (lines=12) @@
521
            return $response;
522
        }
523
524
        DB::transaction(function () {
525
            $updates = $this->prepareUpdate($this->updates);
526
527
            foreach ($updates as $column => $value) {
528
                /* @var Model $this->model */
529
                $this->model->setAttribute($column, $value);
530
            }
531
532
            $this->model->save();
533
534
            $this->updateRelation($this->relations);
535
        });
536
537
        if (($result = $this->complete($this->saved)) instanceof Response) {
538
            return $result;