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