Code Duplication    Length = 11-11 lines in 2 locations

src/Form.php 2 locations

@@ 252-262 (lines=11) @@
249
250
        $this->prepare($data, $this->saving);
251
252
        DB::transaction(function () {
253
            $inserts = $this->prepareInsert($this->updates);
254
255
            foreach ($inserts as $column => $value) {
256
                $this->model->setAttribute($column, $value);
257
            }
258
259
            $this->model->save();
260
261
            $this->saveRelation($this->relations);
262
        });
263
264
        $this->complete($this->saved);
265
@@ 357-367 (lines=11) @@
354
355
        $this->prepare($data, $this->saving);
356
357
        DB::transaction(function () {
358
            $updates = $this->prepareUpdate($this->updates);
359
360
            foreach ($updates as $column => $value) {
361
                $this->model->setAttribute($column, $value);
362
            }
363
364
            $this->model->save();
365
366
            $this->updateRelation($this->relations);
367
        });
368
369
        $this->complete($this->saved);
370