Code Duplication    Length = 7-8 lines in 2 locations

src/DynamicRelations.php 2 locations

@@ 75-81 (lines=7) @@
72
        return new AbstractRelation(['belongsTo', static::class, $relationName, [$related, $foreignKey, $ownerKey, $relationName]]);
73
    }
74
75
    public static function belongs_to_many($relationName, $related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null,
76
        $parentKey = null, $relatedKey = null)
77
    {
78
        $params = [$related, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName];
79
80
        return new AbstractRelation(['belongsToMany', static::class, $relationName, $params]);
81
    }
82
83
    /**
84
     * Define a polymorphic many-to-many relationship.
@@ 98-105 (lines=8) @@
95
     *
96
     * @return \Illuminate\Database\Eloquent\Relations\MorphToMany
97
     */
98
    public function morph_to_many($relationName, $related, $name, $table = null, $foreignPivotKey = null,
99
        $relatedPivotKey = null, $parentKey = null, $relatedKey = null)
100
    {
101
        $params = [$related, $name, $table, $foreignPivotKey,
102
            $relatedPivotKey, $parentKey, $relatedKey, $relationName];
103
104
        return new AbstractRelation(['morphToMany', static::class, $relationName, $params]);
105
    }
106
107
    /**
108
     * Define a polymorphic one-to-many relationship.