Code Duplication    Length = 10-10 lines in 2 locations

src/Relation/BelongsTo.php 1 location

@@ 70-79 (lines=10) @@
67
        return $model;
68
    }
69
70
    public function create(array $values = [])
71
    {
72
        $class = $this->foreignModel;
73
        $model = new $class();
74
        $model->create($values);
75
76
        $this->attach($model);
77
78
        return $model;
79
    }
80
81
    /**
82
     * Attaches this model to an owning model.

src/Relation/BelongsToMany.php 1 location

@@ 107-116 (lines=10) @@
104
        return $model;
105
    }
106
107
    public function create(array $values = [])
108
    {
109
        $class = $this->foreignModel;
110
        $model = new $class();
111
        $model->create($values);
112
113
        $this->attach($model);
114
115
        return $model;
116
    }
117
118
    /**
119
     * Attaches a model to the relationship by creating