Code Duplication    Length = 11-12 lines in 2 locations

src/Form.php 2 locations

@@ 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->callSaved()) instanceof Response) {
550
            return $result;
@@ 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;