Code Duplication    Length = 10-10 lines in 2 locations

src/Relation/BelongsTo.php 1 location

@@ 46-55 (lines=10) @@
43
        return $model;
44
    }
45
46
    public function create(array $values = [])
47
    {
48
        $class = $this->foreignModel;
49
        $model = new $class();
50
        $model->create($values);
51
52
        $this->attach($model);
53
54
        return $model;
55
    }
56
57
    /**
58
     * Attaches this model to an owning model.

src/Relation/BelongsToMany.php 1 location

@@ 80-89 (lines=10) @@
77
        return $model;
78
    }
79
80
    public function create(array $values = [])
81
    {
82
        $class = $this->foreignModel;
83
        $model = new $class();
84
        $model->create($values);
85
86
        $this->attach($model);
87
88
        return $model;
89
    }
90
91
    /**
92
     * Attaches a model to the relationship by creating